vite-node 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +8 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -107,10 +107,15 @@ function normalizeId(id) {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function toFilePath(id, server) {
|
|
110
|
-
|
|
110
|
+
let absolute = id.startsWith('/@fs/')
|
|
111
111
|
? id.slice(4)
|
|
112
112
|
: slash(resolve(server.config.root, id.slice(1)))
|
|
113
113
|
|
|
114
|
+
if (absolute.startsWith('//'))
|
|
115
|
+
absolute = absolute.slice(1)
|
|
116
|
+
if (!absolute.startsWith('/'))
|
|
117
|
+
absolute = `/${absolute}`
|
|
118
|
+
|
|
114
119
|
return absolute
|
|
115
120
|
}
|
|
116
121
|
|
|
@@ -142,13 +147,8 @@ async function execute(files, server, shouldExternalize) {
|
|
|
142
147
|
|
|
143
148
|
debugRequest(absolute)
|
|
144
149
|
|
|
145
|
-
// for windows
|
|
146
|
-
const unifiedPath = absolute[0] !== '/'
|
|
147
|
-
? `/${absolute}`
|
|
148
|
-
: absolute
|
|
149
|
-
|
|
150
150
|
if (shouldExternalize(absolute))
|
|
151
|
-
return import(
|
|
151
|
+
return import(absolute)
|
|
152
152
|
|
|
153
153
|
const result = await server.transformRequest(id, { ssr: true })
|
|
154
154
|
if (!result)
|
|
@@ -156,7 +156,7 @@ async function execute(files, server, shouldExternalize) {
|
|
|
156
156
|
|
|
157
157
|
debugTransform(id, result.code)
|
|
158
158
|
|
|
159
|
-
const url = pathToFileURL(
|
|
159
|
+
const url = pathToFileURL(absolute)
|
|
160
160
|
const exports = {}
|
|
161
161
|
|
|
162
162
|
const context = {
|