I work on an AngularJS codebase with TypeScript which uses ts-node and tsconfig-paths for testing. We have filenames like app/components/whatever.component.ts, which is imported as 'app/components/whatever.component'. These filenames match recommend AngularJS standards, but break requireHooks, which interpret the filenames as being extensions.
My recommended solution is to allow the hooks to be configured with a whitelist for file extensions for passing other file extensions on to whatever other mechanisms are available.
I work on an AngularJS codebase with TypeScript which uses
ts-node
and tsconfig-paths for testing. We have filenames likeapp/components/whatever.component.ts
, which is imported as'app/components/whatever.component'
. These filenames match recommend AngularJS standards, but breakrequireHooks
, which interpret the filenames as being extensions.My recommended solution is to allow the hooks to be configured with a whitelist for file extensions for passing other file extensions on to whatever other mechanisms are available.