I have a bunch of autogenerated modules that i need to reference from my typescript files.
Eg
import test = require('../templates/test')
I am generating CommonJS modules with ES5 output.
So I cant use amd-dependency
(since that works for amd modules only).
And I also cannot manually declare the module since 1. it is autogenerated and 2. it has a relative path.
Typescript 1.6 currently shows an error saying it 'Cannot find module'. How do i make it suppress this error and import?
How do i make it suppress this error and import
If you are sure that the require
statement is valid and want to switch off any type checking on the import, you can just use node.d.ts
and do:
var test = require('../templates/test')
ie. just use var
instead of import
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With