Stylus @import inlining with filename and paths options
0 reputation · 04 Feb 2026, 19:12 UTC
Stylus @import inlining with filename and paths options
The goal is to compile a Stylus entry file with @import directives so nested variables and mixins are inlined into the rendered CSS. Compilation should resolve imports only from a temporary fixture directory and must not require production credentials.
Stylus has no built-in filesystem sandbox, so imports run with the Node process file-system permissions unless the host application restricts them. Resolution depends on filename and paths, and on whether a file is the entry point or nested inside another @import; behavior varies by Stylus version. Missing imports may throw or be handled differently, with no version-independent silent-skip guarantee.
Which combination of filename and paths reliably scopes @import resolution to a fixture directory across Stylus versions? Does renderFile() change entry-point resolution compared with render()? How should missing imports be treated when no version pin is available?