When I run tsickle with esModuleInterop, tsickle produces the wrong javascript, with a regular require instead of goog.require.
Repro steps:
npm install typescript@~3.5.3 tsickle@0.37.0
I wish I could use tsickle 0.37.1, but unfortunally the npm package doesn't have a binary (or a main.js file).
tsconfig.json:
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
}
}
a.ts:
import * as b from './b';
b.foo();
b.ts:
Generated a.js:
goog.module('a');
var module = module || { id: 'a.ts' };
const tsickle_b_1 = goog.requireType("b");
const b = __importStar(require("./b"));
b.foo();
If I don't use import * as ... then the emitted JS is correct.
esModuleInterop is now one of the default flags generated when running tsc --init.