As of TypeScript 1.6.2, there was a "fix" for a long term "defect" which made it impossible to import relative modules into ambient modules, now some of my code is breaking. We utilise an AMD environment where we have a plugin module that loads CommonJS modules when executing under Node. In particular I am using Intern as a testing framework and developing something that is designed to be used only as a CommonJS module.
For example, I used to have this declaration:
declare module 'intern/dojo/node!../../index' {
import * as dtsGenerator from '../../index';
export = dtsGenerator
}
But now I get Import or export declaration in an ambient module declaration cannot reference module through relative module name.
I cannot figure out how to resolve a module absolutely within my ambient module for something contained within my project. As of course the following indicates that index
cannot be found:
declare module 'intern/dojo/node!../../index' {
import * as dtsGenerator from 'index';
export = dtsGenerator
}
To dismiss errors, you can now use:
declare module '*';
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