Skip to content
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

Best practice to ship a library built with Svelte and preprocessors #5445

Closed
pd4d10 opened this issue Sep 23, 2020 · 3 comments
Closed

Best practice to ship a library built with Svelte and preprocessors #5445

pd4d10 opened this issue Sep 23, 2020 · 3 comments

Comments

@pd4d10
Copy link

pd4d10 commented Sep 23, 2020

Is your feature request related to a problem? Please describe.

It is recommended to ship source code (*.svelte) to npm according to this documentation, and the rollup plugin would take these source code and recompile them. However, preprocessors would cause some problems in this case:

  1. It requires users to add the same preprocessors to their app's rollup config.
  2. These preprocessors' config should also be the same as the library to keep consistant.

Describe alternatives you've considered

Very thankful to kaisermann, the solution is quite clearly explained in sveltejs/svelte-preprocess#255 (comment), and I'll do some digging later.

Just wondering If there is other best practice I missed.

How important is this feature to you?

We encountered this problem when developing ByteMD, which is a hackable Markdown editor built with Svelte.

@dummdidumm
Copy link
Member

Related sveltejs/component-template#31

@antony
Copy link
Member

antony commented Sep 23, 2020

I'm not sure how this can be avoided - you're shipping uncompiled code which requires a preprocessor to compile. This will need some thinking about.

@Conduitry
Copy link
Member

Yeah, this is what sveltejs/component-template#8 was opened for. The ideal solution is going to involve shipping preprocessed but uncompiled Svelte components, so that people don't need to use the same preprocessors as you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants