I have a legacy JS file, written in the following RequireJS (AMD) module notation:
define(\'mymodule\', [], function(){
// ... bla bla bla
return {
I am able to load amd module.
here is TS:
import * as MyModule from './mymodule.js';
console.log('my value is', MyModule.value);
mymodule.js file:
define(["require", "exports"], function(require, exports){
exports.value = "aaa";
});
and in tsconfig.js
"allowJs": true
UPDATE:
You can use System.import provided by webpack.
declare var System: any;
System.import('./mymodule.js')
.then(MyModule=>console.log(MyModule.value));