fix(vite): ensure id is javascript before externalizing (#983)

This commit is contained in:
pooya parsa 2021-10-13 22:44:52 +02:00 committed by GitHub
parent 07086c8397
commit ad4e2e98d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,10 @@ function isExternal (opts: TransformOptions, id: string) {
const ssrConfig = (opts.viteServer.config as any).ssr
if (!/\.[cm]?js/.test(id)) {
return false
}
if (ssrConfig.noExternal.find(ext => id.includes(ext))) {
return false
}