ソースを参照

optimize production build settings

Yuki Takei 9 年 前
コミット
33a50f7838
1 ファイル変更7 行追加0 行削除
  1. 7 0
      config/webpack.prod.js

+ 7 - 0
config/webpack.prod.js

@@ -3,6 +3,7 @@
  */
 
 const helpers = require('./helpers');
+const webpack = require('webpack');
 const webpackMerge = require('webpack-merge'); // used to merge webpack configs
 const commonConfig = require('./webpack.common.js'); // the settings that are common to prod and dev
 
@@ -36,6 +37,12 @@ module.exports = function (env) {
     },
     plugins: [
 
+      new webpack.DefinePlugin({
+        'process.env': {
+          NODE_ENV: JSON.stringify(ENV),
+        }
+      }),
+
       new OptimizeJsPlugin({
         sourceMap: false
       }),