Created
October 8, 2019 16:28
-
-
Save sergx/d8eba83fa6a806c728dcb299e2e12d27 to your computer and use it in GitHub Desktop.
Как сделать так, чтобы webpack формировал несколько HTML файлов на выходе
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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