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

Dealing with external svelte components #4

Closed
kaisermann opened this issue May 3, 2018 · 3 comments
Closed

Dealing with external svelte components #4

kaisermann opened this issue May 3, 2018 · 3 comments
Labels

Comments

@kaisermann
Copy link
Member

kaisermann commented May 3, 2018

Since we're excluding /node_modules/ from the svelte-loader, what's the best way to use external svelte components like svelte-routing?

Adding a negative lookahead to the exclusion rule kinda works, but can we assume that every svelte component/package will have the svelte prefix?

{
  test: /\.(html|svelte)$/,
  exclude: /node_modules\/(?!svelte)/,
  ...
}
@Rich-Harris
Copy link
Member

I actually hit this earlier today. I just removed the exclude field altogether in the project I'm working on. The svelte- prefix assumption is probably reasonable, but I don't know if I'd consider it watertight.

@antony
Copy link
Member

antony commented Oct 17, 2018

This just got me :)

Why exclude node_modules? We're entering a world now where there are a fair few third-party svelte components.

Perhaps there should be a recommendation that Svelte components generally use a .svelte suffix, since .html causes Svelte to break in Parcel bundler, too. Im assuming that Vue uses .vue so that there aren't headaches like this.

@benmccann
Copy link
Member

Hopefully this is fixed now with #36

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

No branches or pull requests

4 participants