Comments (14)
And ideally they should match the API options
from lightningcss.
Maybe, but I feel like at that point you should probably be using another build tool like a bundler. For example, like Parcel supports. I was thinking that the Parcel CSS CLI would mainly be used for very simple use cases, as well as debugging/testing. Will have to think about it more, but I don't want to jump straight to config files if we can help it. π
from lightningcss.
Well, in fact, few devs touch .swcrc
directory and many devs handle swc feature via bundler. It would be better to implement only CLI flag and collect feedback from developers, and if there are many requests for such a config file, we would rethink π .
from lightningcss.
I think it is a good idea to add CLI flags to specify parcel-css
βs feature ! π .
I think it would be also good to add loading a config file .parcelcssrc
like .swcrc
to specify parcel-css
βs feature as well as CLI flag, because in real development, devs may want to specify which βparcel-css`βs feature is ON with a static config file. What do you think about this idea?
from lightningcss.
Maybe we could also use miette to get pretty error messages: https://github.com/zkat/miette
from lightningcss.
Also need to figure out a nice way of distributing the CLI. Right now you can install with cargo
but that means you need to compile it yourself. We could potentially publish binaries to npm, or via direct download or something...
from lightningcss.
Hey, I was wondering are you planning to add subcommands? Or just bunch of flags and options to control the behaviour.
from lightningcss.
We could add some, but not sure what they would be. Did you have one in mind? Right now there's parcel_css minify
but maybe it should be --minify
so you could choose whether to enable it or not.
from lightningcss.
I don't think subcommands are the right fit here, as you want to be able to mix the options, just like you can with the API. They should be flags.
from lightningcss.
Yeah, I also think that only flags/options will be the best choice here.
from lightningcss.
I've got a branch where I've started adding some of these.
Leaving it for the night. I've started to write cli integration tests, and will hopefully wrap tomorrow with a good chunk of them done.
for sourcemap and css module files, I think it's probably right to make decent guesses about what the additional output files should be named, but only write to files if the output file option is specified. If not, putting them on stdout seems right, I think.
Questions:
- multiple files option - do we just concat the files to pass them to
Stylesheet::parse
? If so, what should the 'filename' arg be? - for the 'directory' option for multiple files, how should the tree walking pick valid files?
- how should sourcemap and css module json get formatted on stdout, when no output file is specified? (e.g. add a comment like
/* styles.json */
to the output to distinguish them?)
from lightningcss.
Can multiple folks contribute towards this?
from lightningcss.
Can multiple folks contribute towards this?
Probably yes - my branch certainly isn't intended to cut off other contributions, I'm not affiliated with the project, just a web stranger.
It doesn't look like there's a contributors guide specific to this repo, so I'm inferring from parcel js's CONTRIBUTING.md and typical open source contribution ethos, but it's pretty normal for different folks to work on the same feature in parallel. At worst, there's some duplicated effort or bad feelings depending on the eventual outcome, but that's probably okay!
from lightningcss.
Added --targets
in 7d9cec0.
from lightningcss.
Related Issues (20)
- Lightningcss randomly drops a selector, breaking styling
- cli: mis-match between --version and npm package version HOT 1
- [Feature Request]: Support `generate(ast)` API like `csstree`
- Support `overlay` property
- Position of `all` property is not maintained HOT 3
- Add support for custom import resolvers in synchronous bundle API
- Use browserslist entry in package.json (vite)
- lots of :lang() in output HOT 3
- Lightning with Astro: Can't resolve background-image path HOT 1
- Unexpected Token Error with "all" property HOT 1
- Alias another CSS module file to avoid repeating (long) filepaths HOT 2
- CLI error `This: command not found`
- How to implement the use of mixins in the Vite + Vanilla project?
- Don't split unsupported selectors
- Warning when `:is()` contains pseudo-elements
- Allow `composes` inside `@layer`?
- [Bug] grid-template identifiers do not get transformed (with CSS modules) when var() is used HOT 3
- Using `rgb(var(--foo from '...'))` gives unexpected results (in CSS modules with `dashedIdents`)
- Overriding a CSS variable with CSS modules and `dashedIdents`
- /* ERROR: Unexpected token Semicolon */ (IE hacks 5-7) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightningcss.