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;