我正在尝试使我的代码无法识别。我正在使用webpack
和uglify
,但这并不是我想的那样。这是什么样的输出?我真的很想看到没有英文单词,也没有文件名注释。
/***/ "./app/public/wp-content/themes/rise-child/js/maker-two/helpers/constants.js":
/*!*****************************************************************************************!*\
!*** ./app/public/wp-content/themes/rise-child/js/maker-two/helpers/constants.js ***!
\*****************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default_
这是我的webpack
代码,uglify js
插件看起来像正确使用了吗?在命令行中,我尝试运行webpack
和gulpwatch
。
const path = require('path'),
settings = require('./settings');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: {
'scrollerbundled': [settings.themeLocation + "js/1.js"],
'mapbundled': [settings.themeLocation + "js/2.js"],
'sculptor': [settings.themeLocation + "js/3.js"]
},
output: {
path: path.resolve(__dirname, settings.themeLocation + "js-dist"),
filename: "[name].js"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
optimization: {
minimizer: [new UglifyJsPlugin({
uglifyOptions: {
mangle: true,
output: {
comments: false
}
},
sourceMap: true,
exclude: [/\.min\.js$/gi]
})]
},
mode: 'development'
}