0

in the esModuleInterop section of tsconfig documentation, it says:

By default (with esModuleInterop false or not set) TypeScript treats CommonJS/AMD/UMD modules similar to ES6 modules. In doing this, there are two parts in particular which turned out to be flawed assumptions:

a namespace import like import * as moment from "moment" acts the same as const moment = require("moment")

a default import like import moment from "moment" acts the same as const moment = require("moment").default

This mismatch causes these two issues:

but I do not understand the mismatch here, or how it causes issues. Really appreciate it if someone can explain them in clearer terms.

Kallzvx
  • 594
  • 7
  • 23

0 Answers0