Commit 676cdf842e7e00a6f073126a16c9804b98879db0

Authored by huixisheng
1 parent faee0fc8

fixed webpack build error

build/webpack.base.config.js
... ... @@ -62,7 +62,7 @@ module.exports = {
62 62 extensions: ['.js', '.vue'],
63 63 alias: {
64 64 'vue': 'vue/dist/vue.esm.js',
65   - '@': resolve('src'),
  65 + '@': resolve('src')
66 66 }
67 67 }
68 68 };
... ...
build/webpack.dist.dev.config.js
... ... @@ -3,6 +3,8 @@ var webpack = require('webpack');
3 3 var merge = require('webpack-merge')
4 4 var webpackBaseConfig = require('./webpack.base.config.js');
5 5  
  6 +process.env.NODE_ENV = 'production'
  7 +
6 8 module.exports = merge(webpackBaseConfig, {
7 9 entry: {
8 10 main: './src/index.js'
... ... @@ -24,9 +26,10 @@ module.exports = merge(webpackBaseConfig, {
24 26 }
25 27 },
26 28 plugins: [
  29 + // @todo
27 30 new webpack.DefinePlugin({
28 31 'process.env': {
29   - NODE_ENV: '"development"'
  32 + NODE_ENV: '"production"'
30 33 }
31 34 })
32 35 ]
... ...
build/webpack.dist.prod.config.js
... ... @@ -3,7 +3,7 @@ var webpack = require('webpack');
3 3 var merge = require('webpack-merge')
4 4 var webpackBaseConfig = require('./webpack.base.config.js');
5 5  
6   -
  6 +process.env.NODE_ENV = 'production';
7 7  
8 8 module.exports = merge(webpackBaseConfig, {
9 9 entry: {
... ... @@ -26,10 +26,9 @@ module.exports = merge(webpackBaseConfig, {
26 26 }
27 27 },
28 28 plugins: [
  29 + // @todo
29 30 new webpack.DefinePlugin({
30   - 'process.env': {
31   - NODE_ENV: '"production"'
32   - }
  31 + 'process.env.NODE_ENV': '"production"'
33 32 }),
34 33 new webpack.optimize.UglifyJsPlugin({
35 34 compress: {
... ...