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
Is your feature request related to a problem? Please describe.
When building with vite, if a module is not resolved (because of an oversight for instance) it will be externalized by Rollup with a warning. A module being externalized will most likely fail in the browser. However, warnings are hard to catch especially if you use a CI/CD setup, and we can safely assume it is most likely an error. If you do want a module to be external, it should be up to the user to explicitly configure it with rollupInputOptions: { external }
Yes it will [vite] Failed to resolve module import "xxxx". But it is still "easy" to miss.
There is another thing as well which could be another feature:
When using monorepo, let's say you require lodash in two packages but forgot to add it to package.json in one of them. Currently it is going to work in dev because modules are resolved to the optimized lodash, but fail when building (if you use a strict pkg manager). This could be addressed by always trying to resolve the module before routing to the optimized version in dev mode
Is your feature request related to a problem? Please describe.
When building with vite, if a module is not resolved (because of an oversight for instance) it will be externalized by Rollup with a warning. A module being externalized will most likely fail in the browser. However, warnings are hard to catch especially if you use a CI/CD setup, and we can safely assume it is most likely an error. If you do want a module to be external, it should be up to the user to explicitly configure it with
rollupInputOptions: { external }
Describe the solution you'd like
The idea is to use onwarn hook to throw a hard error.
https://rollupjs.org/guide/en/#onwarn
The text was updated successfully, but these errors were encountered: