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

Move @neutrinojs/env into the web preset & support default values #983

Merged
merged 2 commits into from Jul 9, 2018

Conversation

@edmorley
Copy link
Member

edmorley commented Jul 5, 2018

Since EnvironmentPlugin doesn't require any non-webpack dependencies or complex configuration, it's simpler to inline the plugin directly in presets that use it (which is currently just the web preset).

The argument passed to the plugin is now correctly wrapped in an array (as expected by webpack-chain), meaning the object form that allows setting defaults is now also supported:
https://webpack.js.org/plugins/environment-plugin/#usage-with-default-values

The options change is non-breaking, however the removal of @neutrinojs/env is, for people who used it directly.

Closes #657.

edmorley added 2 commits Jul 5, 2018
Since `EnvironmentPlugin` doesn't require any non-webpack dependencies
or complex configuration, it's simpler to inline the plugin directly
in presets that use it (which is currently just the web preset).

The argument passed to the plugin is now correctly wrapped in an array
(as expected by `webpack-chain`), meaning the object form that allows
setting defaults is now also supported:
https://webpack.js.org/plugins/environment-plugin/#usage-with-default-values

Closes #657.
@edmorley edmorley added this to the v9 milestone Jul 5, 2018
@edmorley edmorley self-assigned this Jul 5, 2018
@edmorley

This comment has been minimized.

Copy link
Member Author

edmorley commented Jul 5, 2018

With this PR, we now have 6 fewer lower-level presets on master than we did for Neutrino 8 (minify, babel-minify, chunk, fork, hot and env) - which I think makes the docs/repository/following the preset breadcrumbs much simpler.

@edmorley edmorley requested a review from eliperelman Jul 5, 2018
Copy link
Member

eliperelman left a comment

Bravo!

@edmorley edmorley merged commit 0497a32 into neutrinojs:master Jul 9, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@edmorley edmorley deleted the edmorley:web-env-defaults branch Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.