When utilizing the TypeScript service in WebStorm, an additional line is added to the output:
Object.defineProperty(exports, "__esModule", { value: true });
This can be observed in the following output:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true }); <----------
var rabbit_1 = require("./rabbit");
var r = new rabbit_1.Rabbit();
r.go();
The tsconfig.json
is set up as follows
{
"compilerOptions": {
"module": "commonjs", <---------------
"target": "es5",
"noImplicitAny": false,
"sourceMap": false
}
}
Even though tsc
correctly produces modules in commonjs
, WebStorm still includes this line. What is the reason for that?