Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't always override NODE_ENV in build-storybook #272

Merged
merged 1 commit into from
Jun 23, 2016

Conversation

pcardune
Copy link
Contributor

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.

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.
@arunoda
Copy link
Member

arunoda commented Jun 23, 2016

Yeah. This is great.

@arunoda arunoda merged commit e517327 into storybookjs:master Jun 23, 2016
@arunoda
Copy link
Member

arunoda commented Jun 23, 2016

Published with v1.34.1

@pcardune
Copy link
Contributor Author

Thanks for accepting my change so quickly!

@pcardune pcardune deleted the patch-1 branch June 27, 2016 21:10
@shilman shilman added the misc label May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants