Repository navigation
Report files read through composes and @value as dependencies - #174
Merged
madyankin merged 1 commit intoNov 14, 2026
Merged
Conversation
madyankin
force-pushed
the
fix/report-composed-dependencies
branch
from
November 14, 2026 20:36
add6faa to
20fc4d8
Compare
madyankin
force-pushed
the
fix/report-composed-dependencies
branch
from
November 14, 2026 20:39
20fc4d8 to
5d5b789
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #150 (also reported in #81).
Why
postcss-modules reads the files named in
composes: ... from "./x.css"and@value ... from "./x.css", but it does not report them in the PostCSS result. Runners that rebuild from PostCSSdependencymessages (plugin guidelines, 3.1), such aspostcss --watch, then leave the importing files stale when a composed file changes: their output keeps the old class names and rules.Change
FileSystemLoaderexposes the files it read, including nested imports, asdependencies, in the order their CSS is prepended. The plugin adds adependencymessage for each one, with the processed file (result.opts.from, or the root's source file whenfromis not set) asparent. A customLoaderwithout adependenciesgetter reports nothing, as before.The
exposes export tokens for other pluginstest now snapshots only theexportmessage:values.cssimports a file, and the new message carries an absolute path.Testing
composes.cssreportscomposes.mixins.cssand the nestedcomposes.a.css,values.cssreportsvalues.colors.css, andclasses.cssreports nothing; a root parsed from one path and processed with anotherfromreports the processing path asparent. Both fail onmaster(7bfccb6) and pass here.make test(eslint, swc, jest: 44 tests, 31 snapshots) passes on Node 22.23.4 and 24.22.1 on Linux and on Node 26.8.2 on macOS. Windows not run.--watchmode on adrawer.module.csswith@value treeWrap from "./tree.module.css"andcomposes: treeBase from "./tree.module.css": after editingtree.module.css,masterdoes not rebuild the output, which keeps._treeWrap_17egg_2in red; with this change the output is rebuilt with._treeWrap_g8ssb_2in blue.