mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 10:56:44 +08:00
chore: 添加 Debug 功能
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const pxtoviewport = require('postcss-px-to-viewport')
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
||||
@@ -16,6 +16,7 @@ module.exports = {
|
||||
outputDir: 'dist', //打包输出目录
|
||||
productionSourceMap: true,
|
||||
css: {
|
||||
sourceMap: true,
|
||||
loaderOptions: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
@@ -31,15 +32,15 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
chainWebpack: config => {
|
||||
const { codeInspectorPlugin } = require('code-inspector-plugin');
|
||||
const { codeInspectorPlugin } = require('code-inspector-plugin')
|
||||
|
||||
config.plugin('code-inspector-plugin').use(
|
||||
codeInspectorPlugin({
|
||||
bundler: 'webpack',
|
||||
editor: "webstorm"
|
||||
editor: 'webstorm'
|
||||
})
|
||||
);
|
||||
|
||||
)
|
||||
|
||||
// 移除 prefetch 插件
|
||||
config.plugins.delete('prefetch')
|
||||
// // 压缩代码
|
||||
@@ -52,8 +53,9 @@ module.exports = {
|
||||
devServer: {
|
||||
port: 8082
|
||||
},
|
||||
configureWebpack: {
|
||||
optimization: {
|
||||
configureWebpack: config => {
|
||||
config.devtool = 'source-map'
|
||||
config.optimization = {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
@@ -65,5 +67,5 @@ module.exports = {
|
||||
})
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user