Stylus @require deduplication and path resolution reproducibility
0 reputation · 16 Dec 2022, 23:48 UTC
A repeatable development environment for Stylus CSS needs a consistent compilation outcome across contributors and CI. The goal is to define a single, documented build contract for how files are resolved and included.
Relevant constraints involve documented Stylus features. @require deduplicates a file so it is included only once per compilation, while @import does not guarantee the same behavior. Import resolution is controlled by the paths option and node_modules-style lookup, which can diverge between setups. The JavaScript API stylus.render and the CLI expose overlapping options such as paths, compress and sourcemap, with version-sensitive differences for inline versus external source maps. Variable scoping and transparent mixins also differ from other preprocessors, and the terse optional-brace/optional-semicolon syntax can affect parsing if conventions are not pinned.
There is an unresolved decision about long-term maintenance and integration standardization for teams continuing with Stylus.
Which build integration should be standardized to keep paths, compress and sourcemap behavior consistent across the team? Does @require guarantee single inclusion when a partial is referenced through nested imports? What is the current maintenance status of the Stylus project for long-term support planning?