-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
top-level external
option for setting external modules for both dev
and build
#12711
Comments
I guess you can use a plugin to do this (#12751 (comment)). |
Cool, I'll try that, but is it documented in vitejs.dev? BTW, writing a plugin to do such a thing makes me feel weird, I still think it worse to have a standalone option. |
This could be an option to standardize externalizing things, I've put some related issues regarding this in the team board for discussion. Related: #11854 (comment) |
I realized this is requesting for the same feature as #6582. Closing this in favour of that as it's older, and has a few reactions on the issue. I've left an update of the status of the feature at #6582 (comment) |
Description
There is an option called
build.rollupOptions.external
, but it is only forvite build
. Currently, there is no way to set external modules both fordev
andbuild
.Suggested solution
Add a top-level
external
option, which set external modules for bothdev
andbuild
(including deps optimizer as well). And the default ofbuild.rollupOptions.external
should be changed to be the same as the top-levelexternal
option.Alternative
No response
Additional context
A minimal example that needs to set external modules for both
dev
andbuild
, is to use a javascript library (ESM format) hosted on CDN(or any other server), just like this:Validations
The text was updated successfully, but these errors were encountered: