Skip to content

Commit dbe8ac2

Browse files
committed
Fix regex
1 parent a0a5fa6 commit dbe8ac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module-server/node-resolve.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const resolveFromNodeModules = async (
129129
const cacheKey = resolveCacheKey(id, importer, root);
130130
const cached = resolveCache.get(cacheKey);
131131
if (cached) return cached;
132-
const pathChunks = id.split(/[\/]/g);
132+
const pathChunks = id.split(/[\\/]/g);
133133
const isNpmNamespace = id[0] === '@';
134134
// If it is an npm namespace, then get the first two folders, otherwise just one
135135
const packageName = pathChunks.slice(0, isNpmNamespace ? 2 : 1);

0 commit comments

Comments
 (0)