fix(vite): default export for external packages (#1297)

This commit is contained in:
Anthony Fu 2021-10-21 02:09:49 +08:00 committed by GitHub
parent 92547d8547
commit f7153a3172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ async function transformRequest (opts: TransformOptions, id: string) {
if (await isExternal(opts, id)) {
return {
code: `(global, exports, importMeta, ssrImport, ssrDynamicImport, ssrExportAll) => import('${(pathToFileURL(id))}').then(r => { ssrExportAll(r) })`,
code: `(global, exports, importMeta, ssrImport, ssrDynamicImport, ssrExportAll) => import('${(pathToFileURL(id))}').then(r => { exports.default = r.default; ssrExportAll(r) })`,
deps: [],
dynamicDeps: []
}