|
@@ -2,6 +2,7 @@ const path = require('path');
|
|
|
|
|
|
const CompressionWebpackPlugin = require("compression-webpack-plugin")
|
|
|
const productionGzipExtensions = ['js', 'css']
|
|
|
+let debug =false;
|
|
|
|
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir)
|
|
@@ -9,11 +10,13 @@ function resolve(dir) {
|
|
|
|
|
|
let title = '';
|
|
|
if (process.env.VUE_APP_NODE_NAME == 'production') {
|
|
|
- title = ''
|
|
|
+ title = '';
|
|
|
} else if (process.env.VUE_APP_NODE_NAME == 'test') {
|
|
|
- title = '(测试)'
|
|
|
+ title = '(测试)';
|
|
|
+ debug=true;
|
|
|
} else {
|
|
|
- title = '(开发)'
|
|
|
+ title = '(开发)';
|
|
|
+ debug=true;
|
|
|
}
|
|
|
|
|
|
const Timestamp = new Date().getTime();
|
|
@@ -39,7 +42,7 @@ module.exports = {
|
|
|
compress: true,
|
|
|
},
|
|
|
//不输出map
|
|
|
- productionSourceMap: false,
|
|
|
+ productionSourceMap: debug,
|
|
|
chainWebpack: (config) => {
|
|
|
config.entry.app = ['babel-polyfill', './src/main.js']
|
|
|
config.resolve.alias
|
|
@@ -51,6 +54,9 @@ module.exports = {
|
|
|
config.optimization.minimize(true);
|
|
|
},
|
|
|
configureWebpack: config => {
|
|
|
+ if (debug) { // 开发环境配置
|
|
|
+ config.devtool = 'source-map'
|
|
|
+ }
|
|
|
/* //开启gzip压缩,需要配置Nginx服务器gzip选项开启
|
|
|
config.plugins.push(
|
|
|
new CompressionWebpackPlugin({
|