Prevent error message about NODE_ENV not being 'production' when using ng-redux in the browser #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When including
ng-redux.min.js
in a script tag on a site, the included package throws a message (from redux src/index.js):To avoid this error, we need to webpack ng-redux with the proper 'production' environment to ensure the minified code can be used in a standalone
<script>
tag. I have modified the npmbuild:min
task to do so, which appears to work. At the moment, we get a package that is 3k smaller, but webpack also complains a bit about unreachable code. It doesn't appear to be an issue, and ng-redux continues to work as expected, now without the above warning thrown in the console.There may be a more elegant way of doing this with a webpack config file to avoid the spitting of warnings during webpacking, but for now, this solution does the job for us.