File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
packages/esbuild-plugin-node/src Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -115,16 +115,6 @@ export function openTelemetryPlugin(
115115 } ;
116116}
117117
118- // @see https://github.com/nodejs/node/issues/47000
119- function dotFriendlyResolve ( path : string , directory : string ) : string {
120- if ( path === '.' ) {
121- path = './' ;
122- } else if ( path === '..' ) {
123- path = '../' ;
124- }
125- return require . resolve ( path , { paths : [ directory ] } ) ;
126- }
127-
128118/**
129119 * For a given full path to a module,
130120 * return the package name it belongs to and the local path to the module
@@ -135,7 +125,11 @@ function extractPackageAndModulePath(
135125 path : string ,
136126 resolveDir : string
137127) : { path : string ; extractedModule : ExtractedModule } {
138- const fullPath = dotFriendlyResolve ( path , resolveDir ) ;
128+ // @see https://github.com/nodejs/node/issues/47000
129+ const fullPath = require . resolve (
130+ path === '.' ? './' : path === '..' ? '../' : path ,
131+ { paths : [ resolveDir ] }
132+ ) ;
139133
140134 const nodeModulesIndex = fullPath . lastIndexOf ( NODE_MODULES ) ;
141135 if ( nodeModulesIndex < 0 ) {
You can’t perform that action at this time.
0 commit comments