mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(vite): use pathToFileURL for externals (#819)
This commit is contained in:
parent
f0d23d13d4
commit
47ea41dadb
@ -1,4 +1,5 @@
|
||||
import { builtinModules } from 'module'
|
||||
import { pathToFileURL } from 'url'
|
||||
import { join } from 'pathe'
|
||||
import * as vite from 'vite'
|
||||
import { hashId, uniq } from './utils'
|
||||
@ -57,7 +58,7 @@ async function transformRequest (opts: TransformOptions, id: string) {
|
||||
// Externals
|
||||
if (isExternal(opts, id)) {
|
||||
return {
|
||||
code: `(global, exports, importMeta, ssrImport, ssrDynamicImport, ssrExportAll) => import('${id}').then(r => { ssrExportAll(r) })`,
|
||||
code: `(global, exports, importMeta, ssrImport, ssrDynamicImport, ssrExportAll) => import('${(pathToFileURL(id))}').then(r => { ssrExportAll(r) })`,
|
||||
deps: [],
|
||||
dynamicDeps: []
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user