sveltejs / svelte-cli

Command line interface for Svelte
MIT License
104 stars 18 forks source link

Support passing more options to compiler #28

Closed Conduitry closed 6 years ago

Conduitry commented 6 years ago

It was brought up in Gitter that there's no way to pass store: true to the compiler. This one seems a little weird to implement, though, since we're intending to remove that option and have it effectively always be true in Svelte v2. There are probably also other things that can't be set from the CLI.

I suggest that we add a way to pass any options into the compiler (or at least those whose values are serializable as JSON). That would avoid these from having to get added individually as new features are added to the compiler, would avoid documenting how to pass each option, and would ease the transition to using build tool integrations later.

A simple way to do this would be something like --options '{store:true,cascade:false}' although that's not the most user-friendly to type.

Rich-Harris commented 6 years ago

We could do, yeah. Do we anticipate adding many more options though? I sort of feel like we should do the minimum work possible to maintain svelte-cli while nudging people towards more production-friendly approaches.