Skip to content

fix(build): compile the entry points, not the whole scss tree - #692

Merged
mrholek merged 1 commit into
v6-devfrom
fix/css-compile-entry-points-v6
Aug 4, 2026
Merged

fix(build): compile the entry points, not the whole scss tree#692
mrholek merged 1 commit into
v6-devfrom
fix/css-compile-entry-points-v6

Conversation

@mrholek

@mrholek mrholek commented Aug 4, 2026

Copy link
Copy Markdown
Member

dist/css had six folders in it that nobody asked for.

What happened

css-compile ran in directory mode:

sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/

which compiles every file in the tree that is not a partial. The v6 reorganisation added barrel files — scss/{buttons,content,forms,helpers,layout,mixins}/index.scss, pure @forward aggregators — and because they have no leading underscore, each became an entry point and emitted a stylesheet of its own.

The result, per build:

folder index.css
forms/ 66 956 B — a second copy of the whole forms layer
buttons/ 41 183 B
content/ 19 127 B
layout/ 19 144 B
helpers/ 11 204 B
mixins/ 39 B — mixins emit no CSS

24 files with their minified variants and source maps, roughly 157 kB before minification. They were not gitignored, and files ships dist/{css,js}/**/*.{css,js,map} — so they were headed for the published package, source maps and all (and --embed-sources puts the full Sass into those).

The fix

Name the five real entry points, which is exactly what upstream Bootstrap does — their css-compile lists bootstrap.scss, bootstrap-grid.scss, bootstrap-reboot.scss and bootstrap-utilities.scss, and their scss/forms/index.scss and scss/helpers/index.scss barrels are spelled the same way ours are. Directory mode was the difference, not the file naming — worth keeping in mind, since renaming the barrels to _index.scss would have diverged from a structure we deliberately track.

Verification

Compiled the same tree both ways and diffed:

IDENTYCZNY  coreui.css
IDENTYCZNY  coreui-grid.css
IDENTYCZNY  coreui-reboot.css
IDENTYCZNY  coreui-utilities.css
IDENTYCZNY  themes/bootstrap/bootstrap.css

Byte-identical, all five. The only difference in the output tree is the six barrels that stop being written.

Plus stylelint, bundlewatch and the local pre-push gate (lint → dist → typecheck → sass suite → class API → bundlewatch → js tests).

⚠️ No GitHub CI on this PR — Actions have produced no runs across the org since 13:26 UTC, so nothing was scheduled for this branch. The evidence above is local.

css-compile ran `sass scss/:dist/css/`, which compiles every file in the
tree that is not a partial. The v6 reorganisation added barrel files -
scss/{buttons,content,forms,helpers,layout,mixins}/index.scss, pure
@forward aggregators - so each of them became an entry point and emitted a
stylesheet of its own: 24 files, 157 kB before minification, including a
39-byte mixins/index.css and a forms/index.css that is a second copy of
the forms layer.

They were not gitignored and `files` ships dist/css/**, so they were
headed for npm.

Naming the five real entry points is what upstream Bootstrap does for the
same reason. Verified: all five compile byte-identical to what directory
mode produced.
@mrholek
mrholek merged commit 855ba9b into v6-dev Aug 4, 2026
9 checks passed
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.

1 participant