Out of Ordering Styling Between Dev and Build #335
Replies: 1 comment
-
In short, no. This problem is related to how code is bundled vs how code is loaded during development, and is something that I've observed for years (using Webpack). It boils down to CSS specificity, and usually comes up when you have CSS rules with the same specificity in different components. In your example, if the bundler puts For example, the order could change if the bundler moves Unfortunately, this kind of problem is hard to spot (unless you are doing visual regression testing). A few ways to prevent it:
|
Beta Was this translation helpful? Give feedback.
-
bundle update vite_ruby
.Description 📖
When there are multiple Vue (might happen in other frameworks) entrypoints that depend on the same child component, which causes a separate chunk, the shared component's css file gets loaded in different orders in dev and build mode.
Reproduction 🐞
Repro
Vite Ruby Info
Run
bin/rake vite:info
and provide the output:Screenshots 📷
Dev:
Build:
Would changing this line to be
imports + entries
instead ofentries + imports
resolve the issue? What would be the drawbacks of doing so?Beta Was this translation helpful? Give feedback.
All reactions