diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-23 04:53:33 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-23 04:53:33 +0900 |
| commit | 8cec11c813e8ad3b8fb7d3ce55aa872cf01fe3a3 (patch) | |
| tree | 0a5135b8c17691f81202733be87324acbcd3a5cf /webpack | |
| parent | v3809 (diff) | |
| download | sharkey-8cec11c813e8ad3b8fb7d3ce55aa872cf01fe3a3.tar.gz sharkey-8cec11c813e8ad3b8fb7d3ce55aa872cf01fe3a3.tar.bz2 sharkey-8cec11c813e8ad3b8fb7d3ce55aa872cf01fe3a3.zip | |
Define NODE_ENV for production build
Diffstat (limited to 'webpack')
| -rw-r--r-- | webpack/plugins/index.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index 56e73e5041..1ae63cb430 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -1,3 +1,5 @@ +import * as webpack from 'webpack'; + import consts from './consts'; import hoist from './hoist'; import minify from './minify'; @@ -7,7 +9,12 @@ const isProduction = env === 'production'; export default (version, lang) => { const plugins = [ - consts(lang) + consts(lang), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV) + } + }) ]; if (isProduction) { |