[Build] optimize webpack config

This commit is contained in:
陈嘉涵
2018-05-09 22:44:59 +08:00
parent 26a22fe48f
commit bf05e1e9e1
7 changed files with 11 additions and 20 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
const path = require('path');
const config = require('./webpack.config.dev.js');
const config = require('./webpack.dev.js');
const isMinify = process.argv.indexOf('-p') !== -1;
module.exports = Object.assign({}, config, {
@@ -1,8 +1,7 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const isProduction = process.env.NODE_ENV === 'production';
const { VueLoaderPlugin } = require('vue-loader')
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
mode: 'development',
@@ -17,13 +16,13 @@ module.exports = {
},
devServer: {
host: '0.0.0.0',
stats: 'errors-only',
historyApiFallback: {
rewrites: [
{ from: /^\/zanui\/vant\/examples/, to: '/examples.html' },
{ from: /^\/zanui\/vant/, to: '/index.html' }
]
},
stats: 'errors-only'
}
},
resolve: {
extensions: ['.js', '.vue', '.css'],
@@ -1,8 +1,7 @@
const merge = require('webpack-merge');
const path = require('path');
const devConfig = require('./webpack.config.dev.js');
const devConfig = require('./webpack.dev.js');
module.exports = merge(devConfig, {
module.exports = Object.assign({}, devConfig, {
mode: 'production',
output: {
path: path.join(__dirname, '../docs/dist'),