Skip to content

Instantly share code, notes, and snippets.

@sergx
Created October 8, 2019 16:28
Show Gist options
  • Save sergx/d8eba83fa6a806c728dcb299e2e12d27 to your computer and use it in GitHub Desktop.
Save sergx/d8eba83fa6a806c728dcb299e2e12d27 to your computer and use it in GitHub Desktop.
Как сделать так, чтобы webpack формировал несколько HTML файлов на выходе
//https://github.com/jantimon/html-webpack-plugin/issues/218#issuecomment-183066602
module.exports = {
entry: {
'page1': './apps/page1/scripts/main.js',
'page2': './apps/page2/src/main.js'
},
output: {
path: __dirname,
filename: "apps/[name]/build/bundle.js"
},
plugins: [
new HtmlWebpackPlugin({
inject: false,
chunks: ['page1'],
filename: 'apps/page1/build/index.html'
}),
new HtmlWebpackPlugin({
inject: false,
chunks: ['page2'],
filename: 'apps/page2/build/index.html'
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment