parcel-bundler / parcel-bundler/lightningcss
Better (or configurable) order of built-in transpilation vs custom transforms vs CSS modules
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
It seems that all current transpilation steps happen before any of the custom transforms, but the renaming of idents from CSS modules happening after custom transforms.
I don't know how viable it is, but the way I'd expect it to work:
- Entry custom transforms.
- Built-in transpilation, CSS Modules idents.
- Exit custom transforms.
This way it would be possible to adjust things both before the built-in transpilation, and after CSS Modules.
Use cases:
-
Using a custom
env()visitor to replace it with some value which is then statically transpiled. Example: doing something likecolor-mix(in srgb, env(--my-color), transparent). Right now this will not transpile thecolor-mixas it will be done before the custom transforms, even though we could expand theenv()into a static color. -
Adjusting the ident names for CSS Modules. This could allow to work around things like https://github.com/parcel-bundler/lightningcss/issues/315.
If it is not possible to achieve with the custom setup, I wonder what could be the alternatives?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names built-in transpilation, custom transforms, and CSS Modules, but no files, tests, or entry points. Start by tracing the transform pipeline and existing custom-transform behavior; done means determining whether configurable entry and exit ordering is viable or documenting an alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100