I'm attempting to utilize Typescript modules, but I'm encountering issues with loading them properly. Each time I try to import the module, I receive the following error message in my JS file:
JavaScript runtime error: 'exports' is undefined
In my ajax.ts file, I have the following code:
import * as $ from 'jquery';
export * from './ajax';
export class TsTest
{
}
This is how I am trying to import the module:
import ma = require("./modules/ajax");
function Test()
{
}
I have also attempted loading it like this:
import * as ma from "./modules/ajax";
function Test()
{
}
Regardless of the method I use, I consistently encounter the same runtime error in my js file:
JavaScript runtime error: 'exports' is undefined
// in this line:
Object.defineProperty(exports, "__esModule", { value: true });