Request: --out CLI option should allow filename control
See original GitHub issueThe Problem
Using the CLI --out
option, it is currently not possible to control the filename of the compiled CSS file. All we can do is set the folder where the compiled CSS file is placed.
Thus, basic.styl
always becomes basic.css
.
Many times, people want a different output filename. For example: basic.min.css
or similar names that match patterns expected by various Content Management Systems. (Or to follow their team’s file-naming conventions.)
The Current Workaround
I develop CodeKit and, until now, I’ve worked around this Stylus limitation by having the compiler compile to a temporary folder. I then move the file into the correct spot and rename it as appropriate.
Why The Workaround No Longer Works
With the new source map capabilities, the approach above won’t work. The compiler will calculate the wrong paths because I haven’t told it the real, final output location. I can’t simply move and rename output files any longer.
I’ve actually hacked a new workaround. I still use the “compile and relocate” approach, but I have CodeKit open the CSS file and the source map and edit their contents as appropriate. This works, but it’s slower than having the Stylus CLI do this on its own (because it involves 2x the disk-write operations).
Why This Matters
Stylus is the only language that has this limitation. Both Less and Sass provide users a way to customize the output filename. If Stylus is going to remain competitive, I think it needs to offer this flexibility.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (4 by maintainers)
I’ll see if I can do something about this
@aesthetics-io what do you mean? This feature is not implemented yet.