Code first:
const merge = require("webpack-merge");
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
const common = require("./webpack.common.js");
const webpack = require("webpack");
module.exports = merge(common, {
mode: "production",
devtool: "source-map",
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
// **"production",JSON**
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("production"),
})
]
});
That"s the problem with. Why not just assign a string "production" to , but convert it to a string like JSON instead?
new webpack.DefinePlugin({ "process.env.NODE_ENV": JSON.stringify("production"), })
A problem encountered by a front-end rookie when he went to see the official website. Here is the ides/production/-sharp%E6%8C%87%E5%AE%9A%E7%8E%AF%E5%A2%83" rel=" nofollow noreferrer "> link . Figure it out, why do you need to do this?