From 009ac74214b8dffc9b14f6c3e9413db61798ba9b Mon Sep 17 00:00:00 2001 From: Thomas Thiebaud Date: Fri, 21 Dec 2018 14:37:25 +0100 Subject: [PATCH] fix: remove word production from build --- config/webpack.dev.js | 2 +- config/webpack.prod.js | 2 +- src/ui.prod.ts | 4 ++-- src/ui.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/webpack.dev.js b/config/webpack.dev.js index 4b34801..f73bceb 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -40,7 +40,7 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('development'), + 'process.env.PRODUCTION': false, }), new HtmlWebpackPlugin({ template: 'examples/index.html', diff --git a/config/webpack.prod.js b/config/webpack.prod.js index e1c1e8f..01eb94b 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -41,7 +41,7 @@ module.exports = { cache: true, }), new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production'), + 'process.env.PRODUCTION': true, }), ], }; diff --git a/src/ui.prod.ts b/src/ui.prod.ts index 291bf14..0b5e78c 100644 --- a/src/ui.prod.ts +++ b/src/ui.prod.ts @@ -10,11 +10,11 @@ export const uiFactory = ( setCurrentTestVariation: (testName: string, variation: string) => void, ) => { function show() { - console.log('[Skift] Running in production, UI is disabled'); + console.log('[Skift] UI is disabled'); } function hide() { - console.log('[Skift] Running in production, UI is disabled'); + console.log('[Skift] UI is disabled'); } return { diff --git a/src/ui.ts b/src/ui.ts index 019179c..588981d 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -1,4 +1,4 @@ // tslint:disable-next-line -const ui = process.env.NODE_ENV === 'production' ? require('./ui.prod') : require('./ui.dev'); +const ui = process.env.PRODUCTION ? require('./ui.prod') : require('./ui.dev'); export const uiFactory = ui.uiFactory;