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
Merged

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

merged 2 commits into from Jul 9, 2018

Conversation

edmorley
Copy link
Member

@edmorley 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
Copy link
Member Author

@edmorley 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 eliperelman left a comment

Bravo!

@edmorley edmorley merged commit 0497a32 into neutrinojs:master Jul 9, 2018
2 checks passed
@edmorley edmorley deleted the 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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants