Skip to content

Fix dev/prod CSS loader inconsistencies causing cascade ordering mismatches#7304

Merged
cstns merged 3 commits into
mainfrom
fix/asset-build-mode-inconsistencies
May 20, 2026
Merged

Fix dev/prod CSS loader inconsistencies causing cascade ordering mismatches#7304
cstns merged 3 commits into
mainfrom
fix/asset-build-mode-inconsistencies

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented May 19, 2026

Description

  • Replaced all style-loader usage with MiniCssExtractPlugin.loader across all CSS/SCSS rules, ensuring identical CSS cascade and @layer ordering between development and production builds
  • Added dev-mode–friendly output filenames ([name].js, [name].css, [name][ext]) so developers can still identify assets by name without content hashes
  • Added watchOptions.ignored for frontend/dist/** and node_modules/** to prevent recompile cycles from writeToDisk: true

Note

Vendor CSS/SCSS (node_modules) keeps style-loader in dev because of a source map problem with MiniCssExtractPlugin. When all CSS goes through MiniCssExtractPlugin, it generates a single combined CSS source map covering every module that contributed to the output. Packages like @vuepic/vue-datepicker ship dist/main.css with a /*# sourceMappingURL=main.css.map */ reference — and that .map file points back to .scss source files that aren't even included in the published package. Those phantom paths end up in the combined source map as webpack:// URLs that browser DevTools can't resolve, producing errors on every page load and whenever a developer inspects styles.

Using style-loader for vendor CSS in dev keeps it out of the extracted CSS file entirely — the styles are injected as <style> tags via JS, so they never pollute the MiniCssExtractPlugin source map.

Related Issue(s)

closes #7303

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@cstns cstns requested a review from n-lark May 19, 2026 15:23
@cstns cstns marked this pull request as draft May 19, 2026 15:24
@cstns cstns marked this pull request as ready for review May 19, 2026 15:56
@cstns cstns merged commit 05754fb into main May 20, 2026
28 checks passed
@cstns cstns deleted the fix/asset-build-mode-inconsistencies branch May 20, 2026 09:53
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.

Dev and prod asset builds use different CSS loaders, causing cascade/layer ordering inconsistencies

2 participants