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

Enable esModule by default #485

Closed
edmorley opened this issue Dec 28, 2019 · 3 comments
Closed

Enable esModule by default #485

edmorley opened this issue Dec 28, 2019 · 3 comments

Comments

@edmorley
Copy link

  • Operating System: N/A
  • Node Version: N/A
  • NPM Version: N/A
  • webpack Version: 4
  • mini-css-extract-plugin Version: 0.9.0

Expected Behavior / Situation

The esModule option is enabled by default.

Actual Behavior / Situation

The esModule option is not enabled by default.

Modification Proposal

In #475 a new esModule loader option was added, which causes the loader part of mini-css-extract-plugin to output ES Module style syntax instead of CJS (docs).

Currently the feature is disabled by default, and to gain the benefits (eg improved tree shaking), people have to enable it explicitly by setting it to true.

I propose enabling it by default, so that:

  1. People don't have to know about the feature to gain the benefits (not everyone will read about it/understand the benefits)
  2. Reduce the amount of webpack config boilerplate when using mini-css-extract-plugin

Since webpack 4 already natively supports ES Modules, and mini-css-extract-plugin only supports webpack 4 or newer, it seems this could land as a feature change rather than a breaking change, though I'd be fine with either, so long as we can enable it by default :-)

@alexander-akait
Copy link
Member

It will be enable by default for next version

@edmorley
Copy link
Author

I don't know if you saw (I couldn't tell from your message wording?), but I already opened a PR to make the switch (#486) :-)

@alexander-akait
Copy link
Member

Fixed #602, release will be today

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

Successfully merging a pull request may close this issue.

2 participants