Comments (8)
@zen-li In Neutrino we do the following:
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.
Thanks @eliperelman , that was very helpful.
from webpack-chain.
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.
@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.
Hi @edmorley
I am wondering how to configure multi-main entries with different html template, could you guide me?
Very thankful.
from webpack-chain.
Actually, keeping open for docs.
from webpack-chain.
For those wanna replace whole entry, can do:
const page = 'login'
config.entryPoints.clear()
config.entry(page).add(`src/${page}`)
from webpack-chain.
@eliperelman what documentation would you like to write?
from webpack-chain.
Related Issues (20)
- the allowedHosts can't set 'all' HOT 1
- Missing strictModuleErrorHandling HOT 1
- Dependency Dashboard
- How to add polyfills? HOT 2
- When using vue as Multi Page Application, components in each entry point's internal directory cannot be used in common HOT 1
- Why tap functions return undefined? HOT 1
- Is there a configure for packaging wasm file? HOT 1
- One loader testing multiple file types
- RegExps in include.add, not working on Windows HOT 1
- How to specify filename for entry HOT 2
- config.output.chunkLoadingGlobal is not a function HOT 1
- How do I write this configuration ? HOT 2
- sideEffetcs method ts declare HOT 1
- This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag. HOT 1
- Externals config for specific entry HOT 1
- support asset modules with generator HOT 2
- How to add a plugin developed based on unplugin ? HOT 2
- How to modify Heap Memory Limit? HOT 1
- Does webpack-chain support webpack5 resolve.fallback? HOT 1
- This project is no longer maintained
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-chain.