You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when I enable tsconfig-paths, tsconfig-paths works very well, except when I try to resolve bignumber.js
In my tsconfig.json I have "*": ["*", "src/*", "test/*", "vendor/node_modules/@types/*", "vendor/node_modules/*"],
Somewhere in the code it does require('bignumber.js');
If I trace the code then in match-path.js in function tryResolve() the string replacement is done incorrectly.
if (packageJson && packageJson.main && fileExists(path.join(physicalPath, packageJson.main))) {
var file = path.join(physicalPath, packageJson.main);
return file.replace(path.extname(file), "");
}
variable file is resolved to vendor/node_modules/bignumber.js/bignumber.js.
the file.replace removes the first '.js', so it incorrectly resolves into "vendor/node_modules/bignumber/bignumber.js", not "vendor/node_modules/bignumber.js/bignumber"
The text was updated successfully, but these errors were encountered:
I'll have a look when I get some time, or maybe @Jontem can look at it. However, if you have the time a PR with a failing test would be helpful :-).
pjordaan
changed the title
trouble resolving file if folder resolved file is in folder with '.js' in name.
trouble resolving file if resolved file is in folder with '.js' in name.
Feb 15, 2017
Hi, when I enable tsconfig-paths, tsconfig-paths works very well, except when I try to resolve bignumber.js
In my tsconfig.json I have
"*": ["*", "src/*", "test/*", "vendor/node_modules/@types/*", "vendor/node_modules/*"],
Somewhere in the code it does
require('bignumber.js');
If I trace the code then in match-path.js in function tryResolve() the string replacement is done incorrectly.
variable file is resolved to vendor/node_modules/bignumber.js/bignumber.js.
the file.replace removes the first '.js', so it incorrectly resolves into "vendor/node_modules/bignumber/bignumber.js", not "vendor/node_modules/bignumber.js/bignumber"
The text was updated successfully, but these errors were encountered: