Skip to content

Makefile: recompile CSS when SASS sources change#6

Open
balat wants to merge 1 commit into
masterfrom
css-scss-deps
Open

Makefile: recompile CSS when SASS sources change#6
balat wants to merge 1 commit into
masterfrom
css-scss-deps

Conversation

@balat

@balat balat commented Jun 9, 2026

Copy link
Copy Markdown
Member

Same fix as ocsigen/ocsigen-start#707, for this template.

The $(LOCAL_CSS) rule lists only the npm and external-CSS prerequisites, never the SASS sources, so editing the main stylesheet or a partial under sass/ does not mark the compiled CSS out of date: make keeps serving the stale CSS until it is deleted by hand. Fresh/clean builds are unaffected (the CSS is built once) — this only bites incremental .scss edits.

Fix: list the SASS sources as prerequisites of $(LOCAL_CSS):

$(LOCAL_CSS): $(SASS_SRC) $(wildcard $(SASSDIR)/*.scss) $(wildcard $(SASSDIR)/lib/*.scss) $(PACKAGE_JSON) $(NPM_POSTCSS) $(NPM_AUTOPREFIXER) $(LOCAL_STATIC_CSS)/.import-external-css | check_sass

The wildcards expand to nothing when those directories are absent, so projects without partials are unaffected.

The $(LOCAL_CSS) rule listed only the npm and external-CSS prerequisites,
never the SASS sources, so editing the main stylesheet or a partial under
sass/ did not mark the compiled CSS out of date — make kept serving the
stale CSS until it was deleted by hand. Add $(SASS_SRC) and the sass/
(+ sass/lib/) partials as prerequisites.
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