#webpack
#webpack
Вопрос:
Когда я настраиваю webpack, среда разработки выдает «vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_getU-317402.js»
конфигурация:
module.exports = {
mode: 'development'
......
optimization: {
splitChunks: {
chunks: 'all'
},
runtimeChunk: {
name: entrypoint => `runtimechunk~${entrypoint.name}`
}
},
module: {
rules: [
{
test: /.(sa|sc|c)ss/,
use: [
{ loader: isProduction ? MinCssExtractPlugin.loader: 'style-loader' },
{
loader: 'css-loader',
options: {
importLoaders: 2,
modules: {
localIdentName: isProduction ? '[hash:base64]' : '[path][name]__[local]'
}
}
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: ['autoprefixer']
}
}
},
{ loader: 'sass-loader' }
]
}
]
}
}
Результат:
asset vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_getU-317402.js 925 KiB [emitted] (id hint: vendors)
asset runtimechunk~main.js 42.3 KiB [emitted] (name: runtimechunk~main)
asset main.js 14.3 KiB [emitted] (name: main)
asset src/assets/weChat.jpg 178 KiB [emitted] (auxiliary name: main)
asset index.html 535 bytes [emitted]
Entrypoint main 982 KiB (178 KiB) = runtimechunk~main.js 42.3 KiB vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_getU-317402.js 925 KiB main.js 14.3 KiB 1 auxiliary asset
Когда я настраиваю
splitChunks: {
chunks: 'all'
}
он генерирует:
vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_getU-317402.js
производственная среда в норме, и почему в пакете в среде разработки есть информация, связанная с css-loader / dist / runtime?