Add another layer of directory to webpack chunks

This commit is contained in:
Richard van der Hoff 2017-01-17 11:58:30 +00:00
parent 205676a97d
commit 4a1b04e57b
5 changed files with 24 additions and 15 deletions

View file

@ -40,8 +40,17 @@ module.exports = {
},
output: {
path: path.join(__dirname, "webapp"),
filename: "[hash]/[name].js",
chunkFilename: "[hash]/[name].js",
// the generated js (and CSS, from the ExtractTextPlugin) are put in a
// unique subdirectory for the build. There will only be one such
// 'bundle' directory in the generated tarball; however, hosting
// servers can collect 'bundles' from multiple versions into one
// directory and symlink it into place - this allows users who loaded
// an older version of the application to continue to access webpack
// chunks even after the app is redeployed.
//
filename: "bundles/[hash]/[name].js",
chunkFilename: "bundles/[hash]/[name].js",
devtoolModuleFilenameTemplate: function(info) {
// Reading input source maps gives only relative paths here for
// everything. Until I figure out how to fix this, this is a
@ -80,7 +89,7 @@ module.exports = {
}),
new ExtractTextPlugin(
"[hash]/[name].css",
"bundles/[hash]/[name].css",
{
allChunks: true
}