Skip to content

Commit

Permalink
fix: remove word production from build
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasthiebaud committed Jan 2, 2019
1 parent a78fcf8 commit 009ac74
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
cache: true,
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
'process.env.PRODUCTION': true,
}),
],
};
4 changes: 2 additions & 2 deletions src/ui.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 009ac74

Please sign in to comment.