Skip to content

Commit

Permalink
Don't always override NODE_ENV in build-storybook
Browse files Browse the repository at this point in the history
My webpack configuration uses the `DefinePlugin` to make `process.env.NODE_ENV` available to my react components, which in turn optionally do different things depending on the NODE_ENV (related to debugging and such).

Unfortunately, these development-only features don't show up when I use `build-storybook` because `build-storybook` overrides `process.env.NODE_ENV`.

While I think it is quite reasonable for `build-storybook` to default to a "production ready" build, it should not unconditionally override the `NODE_ENV` environment variable to do so.

This change makes `"production"` the default, but also allows people to set a different `NODE_ENV` value and have it get used.
  • Loading branch information
pcardune authored Jun 22, 2016
1 parent 9221b1c commit 1b43a66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

process.env.NODE_ENV = 'production';
process.env.NODE_ENV = process.env.NODE_ENV || 'production';

import webpack from 'webpack';
import program from 'commander';
Expand Down

0 comments on commit 1b43a66

Please sign in to comment.