Skip to content

Commit d08551f

Browse files
committed
fix(react): glob paths prefix on win32
1 parent 3c4323c commit d08551f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/fastify-react/plugin/virtual.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const virtualModules = [
2323
export const prefix = /^\/?\$app\//
2424

2525
export async function resolveId (id) {
26+
// Paths are prefixed with .. on Windows by the glob import
27+
if (process.platform === 'win32' && /^\.\.\/[C-Z]:/.test(id)) {
28+
return id.substring(3)
29+
}
30+
2631
if (prefix.test(id)) {
2732
const [, virtual] = id.split(prefix)
2833
if (virtual) {

0 commit comments

Comments
 (0)