-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional CLI features #52
Comments
I think it is a good idea to add CLI flags to specify I think it would be also good to add loading a config file |
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. 😄 |
Well, in fact, few devs touch |
Maybe we could also use miette to get pretty error messages: https://github.com/zkat/miette |
Also need to figure out a nice way of distributing the CLI. Right now you can install with |
Hey, I was wondering are you planning to add subcommands? Or just bunch of flags and options to control the behaviour. |
We could add some, but not sure what they would be. Did you have one in mind? Right now there's |
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. |
Yeah, I also think that only flags/options will be the best choice here. |
And ideally they should match the API options |
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:
|
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! |
Added |
As of #44 we have a basic CLI. Currently it can minify and output to stdout or a file, but might be nice to add a few more features.
--targets
option. Could accept a browserslist and convert them to Parcel CSS targets withbrowserslist-rs
(see Suggestion: Consider switching to "browserslist-rs" #37).--sourcemap
option. Should output a source map file in addition to a css file, and add asourceMappingUrl
comment to the CSS.--nesting
option to enable parsing CSS nesting.--css-modules
option to enable CSS modules. Output a JSON file in addition to compiled CSS?The text was updated successfully, but these errors were encountered: