@@ -21,6 +21,7 @@ import {
2121 fetchPackageManifest ,
2222 readPackageJson ,
2323} from '@socketsecurity/registry/lib/packages'
24+ import { normalizePath } from '@socketsecurity/registry/lib/path'
2425import { escapeRegExp } from '@socketsecurity/registry/lib/regexps'
2526import { naturalCompare } from '@socketsecurity/registry/lib/sorts'
2627
@@ -356,13 +357,19 @@ function resetDependencies(deps) {
356357export default async ( ) => {
357358 // Lazily access constants path properties.
358359 const { configPath, distPath, rootPath, srcPath } = constants
359- const nmPath = path . join ( rootPath , NODE_MODULES )
360- const constantsSrcPath = path . join ( srcPath , 'constants.mts' )
361- const externalSrcPath = path . join ( srcPath , 'external' )
362- const blessedContribSrcPath = path . join ( externalSrcPath , BLESSED_CONTRIB )
363- const shadowNpmBinSrcPath = path . join ( srcPath , 'shadow/npm/bin.mts' )
364- const shadowNpmInjectSrcPath = path . join ( srcPath , 'shadow/npm/inject.mts' )
365- const utilsSrcPath = path . join ( srcPath , UTILS )
360+ const nmPath = normalizePath ( path . join ( rootPath , NODE_MODULES ) )
361+ const constantsSrcPath = normalizePath ( path . join ( srcPath , 'constants.mts' ) )
362+ const externalSrcPath = normalizePath ( path . join ( srcPath , 'external' ) )
363+ const blessedContribSrcPath = normalizePath (
364+ path . join ( externalSrcPath , BLESSED_CONTRIB ) ,
365+ )
366+ const shadowNpmBinSrcPath = normalizePath (
367+ path . join ( srcPath , 'shadow/npm/bin.mts' ) ,
368+ )
369+ const shadowNpmInjectSrcPath = normalizePath (
370+ path . join ( srcPath , 'shadow/npm/inject.mts' ) ,
371+ )
372+ const utilsSrcPath = normalizePath ( path . join ( srcPath , UTILS ) )
366373
367374 return [
368375 // Bundle <root>/src/ entry point files and output to <root>/dist/.
@@ -397,7 +404,7 @@ export default async () => {
397404 case shadowNpmInjectSrcPath :
398405 return SHADOW_NPM_INJECT
399406 default :
400- if ( id . startsWith ( utilsSrcPath ) ) {
407+ if ( id . startsWith ( ` ${ utilsSrcPath } /` ) ) {
401408 return UTILS
402409 }
403410 if ( id . includes ( SLASH_NODE_MODULES_SLASH ) ) {
0 commit comments