首先: webpack.config
mode: 'development',
name: 'dev',
target: 'web',
entry: {
'app': [
'webpack/hot/dev-server',
APP_DIR + '/client/app.tsx'
]
},
output: {
filename: '[name].js',
chunkFilename: '[name].[chunkhash].js',
path: BUILD_DIR,
publicPath: 'http://localhost:8080/'
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
priority: -20,
chunks: 'all'
}
}
}
},
以下是标准输出,runtime.js的名称上没有哈希码。
第二:当我如下更改输出时:
output: {
filename: '[name].[chunkhash].js',
path: BUILD_DIR,
publicPath: 'http://localhost:8080/'
},
我得到以下结果:
我如何像其他块文件一样对命名为runtime.js文件的哈希码?