Inconsistent order of CSS rules between dev and build #39076
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
When I run
gatsby develop
the order of CSS classes is as expected. When building the CSS order appears to be different in some cases.I expect that CSS Module files that are imported earlier will appear before classes from CSS Module files that are imported later.
In my reproduction example this is not the case after building. One CSS class that is imported late, appears too early in the CSS.
If you run
npm run start
you will see this:If you run
npm run build && npx serve public
you will see this instead:This might be related to a CSS Module file that is imported inside an example component library package in
node_modules
.Reproduction Link
https://github.com/receter/gatsby-css-order-issue
Steps to Reproduce
Clone https://github.com/receter/gatsby-css-order-issue
Run dev server: The text is blue
Build and serve: The text is black
Expected Result
The text should be blue
Actual Result
The text is black when built
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: