Skip to content

Commit 967eb0f

Browse files
aversinisapegin
authored andcommitted
Fix: Do not override NODE_ENV if already set (styleguidist#474)
1 parent 6b1be52 commit 967eb0f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bin/styleguidist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require('../scripts/utils/ensureWebpack');
3838

3939
// Set environment before loading style guide config because user’s webpack config may use it
4040
const env = command === 'build' ? 'production' : 'development';
41-
process.env.NODE_ENV = env;
41+
process.env.NODE_ENV = process.env.NODE_ENV || env;
4242

4343
// Load style guide config
4444
let config;

src/rsg-components/ReactComponent/ReactComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Slot from 'rsg-components/Slot';
88
import { DOCS_TAB_USAGE } from '../slots';
99
import ReactComponentRenderer from 'rsg-components/ReactComponent/ReactComponentRenderer';
1010

11-
const ExamplePlaceholder = process.env.NODE_ENV === 'development'
11+
const ExamplePlaceholder = process.env.NODE_ENV !== 'production'
1212
? require('rsg-components/ExamplePlaceholder').default
1313
: () => <div />;
1414

0 commit comments

Comments
 (0)