Currently, I am working on a substantial project that heavily relies on JavaScript. To enhance its functionality, I am considering incorporating TypeScript into the codebase. While things are running smoothly for the most part, I have encountered an issue with the numerous path aliases and packages present in the project.
import foo = require('foo');
When this line is executed at runtime, it depends on a specific path configuration:
require.config({
paths: {
foo: 'foobar/baz/js/quux'
}
});
As expected, the TypeScript compiler flags an error:
error TS2307: Cannot find module 'foo'
Is there a way to incorporate my requirejs configuration to satisfy the compiler's needs? Alternatively, can I suppress or ignore this error without causing any adverse effects? Despite the error, the resulting JavaScript functions properly. If I choose to suppress the error, I am concerned about potential drawbacks. Is there a method to specify the location of all modules within the project?