Skip to content

Commit

Permalink
Add note about limitation in vite-plugin-svelte(#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jun 20, 2021
1 parent d259bca commit 2fb0386
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions documentation/faq/70-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ Old beta versions of the SvelteKit template included the configuration value `no
The second most commonly-encountered issue is having a Svelte component that imports a CommonJS library. In this case, you should try to work with the library authors to distribute an ESM version of the dependency. However, in the meantime, you can workaround this issue by adding the dependency to `vite.optimizeDeps.include` in `svelte.config.js`.
Also, some Svelte libraries doesn't work nicely with Vite's pre-bundling process, do check out `@sveltejs/vite-plugin-svelte`'s docs on its current [limitation and workaround](https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/vite-plugin-svelte#importing-third-party-svelte-libraries).
If you are still encountering issues we recommend searching both [the Vite issue tracker](https://github.com/vitejs/vite/issues) and the issue tracker of the library in question. Sometimes issues can be worked around by fiddling with the [`optimizeDeps`](https://vitejs.dev/config/#dep-optimization-options) or [`ssr`](https://vitejs.dev/config/#ssr-options) config values.

0 comments on commit 2fb0386

Please sign in to comment.