-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Do you want to request a feature or report a bug?
A bug.
What is the current behavior?
Browser fails to import chunk because filechunkhash is undefined in vendor.js.
But chunks generated correctly.
Screenshots:
It works in WP3. It also works if [chunkhash] is removed or [hash] is used in output.filename
If the current behavior is a bug, please provide the steps to reproduce.
I have a tree of async chunks which are imported the following way:
import(/* webpackChunkName: "home" */ './home.js')
when home is mounded it imports
import(/* webpackChunkName: "socketio" */ 'socket.io-client')
WP4 config:
// config written in ES6 class syntax
...
output.filename = 'js/[name].[chunkhash].js';
optimization = {
namedChunks: true,
runtimeChunk: {
name: 'vendor',
},
splitChunks: {
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all',
},
},
},
};
...What is the expected behavior?
Correct file name reference in vendor.js is expected.
Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
- Win10x64
- Node 9.11.1
- NPM 5.6.0
- Webpack 4.5.0