As mentioned in the title, in this line:
const filenameInLocalNodeModules = !path.relative(localNodeModules, filename).startsWith('..');filenameInLocalNodeModules always true,because path.relative(localNodeModules, filename) always return filename. However, it is a absolute path and it does not start with “..”
As mentioned in the title, in this line:
const filenameInLocalNodeModules = !path.relative(localNodeModules, filename).startsWith('..');
filenameInLocalNodeModules
alwaystrue
,becausepath.relative(localNodeModules, filename)
always returnfilename
. However, it is a absolute path and it does not start with “..”