我想在构建中禁用Webpack src.js
文件。因为它很空,什么也没坐。
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],[],[[39,2,1,0]]]);
这是该文件中唯一的东西。
输出的文件:
mywebsite-vendors.min.b08ecf8da2828e0bd685.js
mywebsite.min.b08ecf8da2828e0bd685.js
runtime.min.b08ecf8da2828e0bd685.js
src.min.b08ecf8da2828e0bd685.js
如何禁用此文件?
部分Webpack代码:
optimization: {
minimize: ifProduction(true,false),namedmodules: ifDevelopment(true,runtimeChunk: 'single',noEmitOnErrors: true,splitChunks: {
hidePathInfo: true,chunks: 'all',automaticNameDelimiter: '-',maxAsyncRequests: 6,maxInitialRequests: 4,name: THEME_NAME,cacheGroups: {
default: {
enforce: true,priority: 1
},vendors: {
test: /[\\/]node_modules[\\/]/,name: `${THEME_NAME}-vendors`,enforce: true,priority: 2,chunks: 'all'
}
}
},minimizer: [
new TerserPlugin({
test: /\.js(\?.*)?$/i,cache: true,parallel: true,sourceMap: ifDevelopment(true,extractComments: false,terserOptions: {
compress: {
drop_console: ifProduction(true,false)
}
},exclude: /\/node_modules/
})
]
},