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

sideEffects: false leads to different modules order between dev & prod #10413

Closed
Hypnosphi opened this issue Feb 19, 2020 · 2 comments
Closed

Comments

@Hypnosphi
Copy link
Contributor

Hypnosphi commented Feb 19, 2020

Moved from webpack-contrib/mini-css-extract-plugin#501

  • Operating System: Mac OS Catalina
  • Node Version: 12.15.0
  • NPM Version: 6.13.4
  • webpack Version: 4.41.4
  • mini-css-extract-plugin Version: 0.9.0

Expected Behavior

Rules order is consistent between development and production

Actual Behavior

Rule order is defined by imports order in development, and by usage order in production

Code / How Do We Reproduce?

https://github.com/Hypnosphi/style-loader-duplicates/tree/mcep

Note that I import a before b, but use b before a. This leads to text being red in dev and blue in prod

import {a} from './a.css'
import {b} from './b.css'

document.body.innerHTML = `<div class="${b} ${a}">Text</div>`
@Hypnosphi Hypnosphi changed the title sideEffects: false + mini-css-extract-plugin: different rules order between dev & prod sideEffects: false leads to different modules order between dev & prod Feb 19, 2020
@Hypnosphi
Copy link
Contributor Author

It also reproduces if I use style-loader instead of mini-css-extract-plugin

@Hypnosphi
Copy link
Contributor Author

Probably a duplicate of #7094

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

No branches or pull requests

1 participant