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

Per component compiler options #93

Closed
glinesbdev opened this issue May 17, 2019 · 1 comment · Fixed by #158
Closed

Per component compiler options #93

glinesbdev opened this issue May 17, 2019 · 1 comment · Fixed by #158

Comments

@glinesbdev
Copy link

Similar to #76 but extended.

While configuring Svelte via Webpack using svelte-loader, I see that you can set compiler options. The option that I am most interested in is customElement. It seems that you can either have Svelte compile down to only custom elements or only Svelte class objects, but not both.

In trying to configure only one component, I came across <svelte:options> which you can specify the tag name of the custom element. Is there a way to selectively compile a Svelte component to a custom element in an "opt-in" style like <svelte:options>?

@0gust1
Copy link

0gust1 commented May 18, 2019

imho it's more a webpack question.

You could use the loaders options (https://survivejs.com/webpack/loading/loader-definitions/) or maybe even write a function in your webpack config that contextually feed options to the loader.

You could also for example split your webpack base config across several files and require the wanted options from there (it would be useful for "per set of components" options). See https://survivejs.com/webpack/developing/composing-configuration/

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

Successfully merging a pull request may close this issue.

2 participants