元亮 赞了回答 · 2017-06-28
The reason you are seeing this is because the output.filename
property is supposed to only contain the name of the file itself.
What is happening is that webpack is assuming the folder path before it, and then using the [hash]
id of the lazy loaded bundles you are creating as the folder names.
My best guess would be that you could instead change this to:
const path = require('path');
module.exports = {
// ...
output: {
path: path.join(__dirname, "dist"),
filename: "bundle-[hash].js"
}
// ...
};
The reason you are seeing this is because the output.filename property is supposed to only contain the name of the file itself.