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

Feature flags always returns TRUE #25

Open
lenage opened this issue Apr 9, 2015 · 1 comment
Open

Feature flags always returns TRUE #25

lenage opened this issue Apr 9, 2015 · 1 comment

Comments

@lenage
Copy link

lenage commented Apr 9, 2015

In example:

var definePlugin = new webpack.DefinePlugin({
  __DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'true')),
  __PRERELEASE__: JSON.stringify(JSON.parse(process.env.BUILD_PRERELEASE || 'false'))
});

__DEV__ always be true even i BUILD_DEV is undefined.

JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'true')) => 'true'

maybe we should update this example to make __DEV__ return true only when BUILD_DEV exist.

for example:

JSON.stringify(typeof(process.env.BUILD_DEV) !== undefined)
@colinrymer
Copy link
Contributor

I also noticed this when reading through the README.

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

No branches or pull requests

2 participants