I have an obsolete JS file written in the following notation of the RequireJS module (AMD):
define('mymodule', [], function(){
return {
calculate: function() { return 1 + 1; }
};
});
I am importing this file from another (old) project that uses RequireJS, therefore - I cannot change the definition of the module used .
I want to import it into an Angular Cli application (Angular 4.x) written in TypeScript.
Since Angular Cli uses Webpack 2 to create projects that support AMD, I thought I could import it as follows:
import * as MyModule from './mymodule.js';
... but this does not work, it causes an error that is mymodule.jsnot a module.
Any ideas (or workarounds) on how I can import this deprecated module?