webpack plugin that allows for trivial configuration for multi page web applications
Currently to architect a webpack configuration for multi page web applications, there are many requirements for managing all assets and entry points.
Each entry point will have some sort of index.html
file or a MVC framework specific server template (partial) which renders to html content.
html-webpack-plugin
for each entry however posses extra configuration challenges:An example for a Laravel 4 Application using Twig Templates
const templatesFn = (modules, twigRoot, assetsRoot, shared) => {
return Object.keys(modules).map((entryName) => {
return new HtmlWebpackPlugin({
template: `${assetsRoot}/webpack.template.hbs`, //path.resolve(__dirname, "./assets/webpack.template.hbs"),
filename: `${twigRoot}/webpack-bundles/${entryName}.twig`,
chunks: ['inline', 'vendors', entryName, `${shared}`]
})
});
}
npm install
npm t
npm run test:watch
sharedChunkName
vendorChunkName
inlineChunkName
templateFilename
templatePath
htmlTemplatePath