提交 e9057307 编写于 作者: fxy060608's avatar fxy060608

fix(app-plus): Ensure ASCII-safe (production)

上级 338eb230
......@@ -36,9 +36,21 @@ module.exports = {
copyOptions.push(path.resolve(__dirname, '../dist/view.css'))
copyOptions.push(path.resolve(__dirname, '../dist/view.umd.min.js'))
// TODO 后续common与v3目录应该合并
copyOptions.push(path.resolve(__dirname, process.env.UNI_USING_NVUE_COMPILER ? '../template/common' : '../template/weex'))
copyOptions.push(path.resolve(__dirname, process.env.UNI_USING_NVUE_COMPILER ? '../template/common'
: '../template/weex'))
copyOptions.push(path.resolve(__dirname, '../template/v3'))
}
return copyOptions
},
chainWebpack (config) {
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer('terser').tap((args) => {
if (!args[0].terserOptions.output) {
args[0].terserOptions.output = {}
}
args[0].terserOptions.output.ascii_only = true
return args
})
}
}
}
}
......@@ -2,7 +2,8 @@ const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const VueLoaderPlugin = require('@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const {
getNVueMainEntry,
......@@ -238,7 +239,16 @@ module.exports = function () {
hints: false
},
optimization: {
namedModules: false
namedModules: false,
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
ascii_only: true
}
}
})
]
},
output: {
path: process.env.UNI_OUTPUT_DIR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册