Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

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.

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 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 July 5, 2018 12:31
Copy link
Member

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bravo!

@edmorley edmorley merged commit 0497a32 into neutrinojs:master Jul 9, 2018
@edmorley edmorley deleted the web-env-defaults branch July 9, 2018 16:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants