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

Enable mini-css-extract-plugin's esModule mode #1511

Closed
edmorley opened this issue Dec 22, 2019 · 1 comment · Fixed by #1514
Closed

Enable mini-css-extract-plugin's esModule mode #1511

edmorley opened this issue Dec 22, 2019 · 1 comment · Fixed by #1514

Comments

@edmorley
Copy link
Member

mini-css-extract-plugin v0.9.0 added an esModule option that makes the plugin output JS using ES modules instead of CJS syntax:
webpack-contrib/mini-css-extract-plugin#475
https://github.com/webpack-contrib/mini-css-extract-plugin#esmodule

This allows webpack's module concatenation and tree shaking to work more effectively.

Since webpack 4 supports ESM (and iirc will never output ESM itself) this seems like something we can enable without it being a breaking change.

@edmorley
Copy link
Member Author

edmorley commented Dec 28, 2019

I've filed webpack-contrib/mini-css-extract-plugin/issues/485 for enabling the feature by default upstream.

edmorley added a commit that referenced this issue Jan 28, 2020
This makes the loader part of `mini-css-extract-plugin` output JS using
ES modules syntax instead of CJS, allowing webpack's module concatenation
and tree shaking features to work more effectively:
https://github.com/webpack-contrib/mini-css-extract-plugin#esmodule

Fixes #1511.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

1 participant