Giter Club home page Giter Club logo

Comments (8)

eliperelman avatar eliperelman commented on September 15, 2024 5

@zen-li In Neutrino we do the following:

https://github.com/mozilla-neutrino/neutrino-dev/blob/5b78b4134489a667e72d366c7b4b3a3f357315e0/packages/web/index.js#L119-L134

The process here is to create an entry and an instance of html-webpack-plugin/template for every main entry you have.

['index', 'admin'].forEach(page => {
  config.entry(page).add(`src/${page}`);

  config.plugin(`html-${page}`).use(HtmlWebpackPlugin, [{
    filename: `${page}.html`
  }]);
});

from webpack-chain.

zen-li avatar zen-li commented on September 15, 2024 1

Thanks @eliperelman , that was very helpful.

from webpack-chain.

edmorley avatar edmorley commented on September 15, 2024

Hi!

Multiple entrypoints and/or multi-main entries are defined like so:

config
  .entry('index')
    .add('src/index.js')
    .end()
  .entry('a-second-page')
    .add('src/foo.js')
    .add('src/bar.js')
    .end();
  .entry('a-third-page')
    .add('src/baz.js');

If there's a way to make this clearer in the docs we'd more than gratefully accept a PR if you had a spare moment? :-)

from webpack-chain.

jujubone avatar jujubone commented on September 15, 2024

@edmorley Thank you very much for your answer.
My English is not very good, so there is nothing I can do to enhance the docs.
I'm sorry.

from webpack-chain.

zen-li avatar zen-li commented on September 15, 2024

Hi @edmorley
I am wondering how to configure multi-main entries with different html template, could you guide me?

Very thankful.

from webpack-chain.

eliperelman avatar eliperelman commented on September 15, 2024

Actually, keeping open for docs.

from webpack-chain.

up9cloud avatar up9cloud commented on September 15, 2024

For those wanna replace whole entry, can do:

const page = 'login'
config.entryPoints.clear()
config.entry(page).add(`src/${page}`)

from webpack-chain.

yordis avatar yordis commented on September 15, 2024

@eliperelman what documentation would you like to write?

from webpack-chain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.