-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Cannot pass an npm dependency as an entrypoint to build #6576
Comments
For context, Astro's If this is intentional and there's another approach we should be using, please let us know. This is currently blocking our upgrade to |
I didn't know rollup supports packages as input target. For now you could use In this case we could check the existence of entry point and fallback to original value if it's not exist. |
@sibbng the reproduction from @matthewp works fine in rollup, and I think it should also work in Vite. We shouldn't force users to use |
@patak-dev I'm not saying this doesn't need to be fixed 😀
|
I think we should revert and find a very good reason to change the default way rollup input works. Reviewing the issue where we change this, I think we didn't justify the change enough. The linked unocss issue could have been resolved by resolving in the config, no? |
Ok, I look back the issue in unocss. Error comes from |
Describe the bug
If you attempt to pass an npm dependency to vite.build's
rollupOptions.input
you will get an error like this:This is a regression caused here: https://github.com/vitejs/vite/pull/5601/files#diff-aa53520bfd53e6c24220c44494457cc66370fd2bee513c15f9be7eb537a363e7R272-R286
It assumes that all entrypoints are files within the project root and not npm package dependencies.
Reproduction
https://stackblitz.com/edit/vitejs-vite-pcuytf?file=build.mjs
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: