You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use a NPM package that isn't transpiled. Seems like babel/webpack can be configured, and Next.js added an option for it. Is it something Vite also can support?
Suggested solution
Possibly by adding something like this in the config:
is your purpose of transpile mostly required for hot reloading? if so i just found this hotreload library, which does it by settings the watch on all files from root. works perfect with my monorepo setup and SSR, havent test changes with on page states yet, might not work with that.
import liveReload from "vite-plugin-live-reload"
plugins: [
liveReload('**/*'),
....
]
As long as the NPM package is written in ESM, you can do so today with optimizeDeps.exclude: ["that-dep"]. And it'll go through Vite's process. If that-dep has transitive deps that are not ESM, you can add optimizeDeps.include: ["that-dep > cjs-dep"]. vite-plugin-svelte has been doing these automatically for raw Svelte libraries. Another option is to have Vite plugins apply #6801, but it's still at experimental stage.
Does the optimizeDeps flow work for you @flip-it? If so we could close this issue.
Clear and concise description of the problem
I need to use a NPM package that isn't transpiled. Seems like babel/webpack can be configured, and Next.js added an option for it. Is it something Vite also can support?
Suggested solution
Possibly by adding something like this in the config:
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: