我正在一个React项目中,我不想缩小messages.js
文件。我很累在exclude: [/\.min\.js$/gi, /messages\.js$/]
中添加uglifyJSPlugin
,但是没有用。我不确定这是否可能。
这是我的目录结构:
app/
components/
MyComponent/
index.js
messages.js // i don't want to minify this file in my app
这是webpack配置:
new webpack.optimize.UglifyJsPlugin({
comments: false, // remove comments
mangle: true,
compress: {
unused: true,
dead_code: true, // big one--strip code that will never execute
warnings: false, // Suppress uglification warnings
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true,
drop_debugger: true,
conditionals: true,
evaluate: true,
drop_console: true, // strips console statements
sequences: true,
booleans: true,
if_return: true,
join_vars: true,
},
output: {
comments: false,
},
exclude: [/\.min\.js$/gi, /messages\.js$/], // skip pre-minified libs
}),