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

feat(webpack-5): opt-in to transitive only side effects #599

Merged
merged 1 commit into from Oct 7, 2020

Conversation

sokra
Copy link
Member

@sokra sokra commented Oct 7, 2020

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

mini-css leaves empty "// extract by ..." js modules in the bundle. They are unnecessary.
webpack 5 will analyse the source code as side-effect-free, but as it contains a custom dependency (CssDependency), this dependency also need to opt-in into being side-effect-free. But actual it's not completely side-effect-free as it points to CssModules that need to be included in the bundle. So this PR opts in into a "transitive only" side-effects mode, which allows to drop the js module but keeps the dependencies in the bundle.

Breaking Changes

None

Additional Info

@codecov
Copy link

codecov bot commented Oct 7, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@ef4bd79). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #599   +/-   ##
=========================================
  Coverage          ?   88.00%           
=========================================
  Files             ?       10           
  Lines             ?      600           
  Branches          ?      155           
=========================================
  Hits              ?      528           
  Misses            ?       69           
  Partials          ?        3           
Impacted Files Coverage Δ
src/CssDependency.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef4bd79...0d8f925. Read the comment docs.

@l5oo00
Copy link

l5oo00 commented Jan 7, 2021

This feature may make the effect of optimization.chunkIds: "deterministic" not as expected.

The example repository: https://github.com/l5oo00/demo-for-mini-css-extract-plugin

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 this pull request may close these issues.

None yet

3 participants