-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.7.0-dev.201xxxxx
Contrary to the documentation (https://www.typescriptlang.org/docs/handbook/modules.html), using import assignment when targeting ES2015/ES6/ESNEXT does NOT emit import statements in the generated JS.
Code
This is my input file:
import m = require('m')
m('123')$ tsc -t ESNEXT index
Expected behavior:
import * as m from "m"
m('123')As described by the documentation
Actual behavior:
m('123')See also this playground (this is 2.4.2, but I tested locally with @latest)
The import is completely omitted
Background info: I am depending on JS libraries which module.exports = someFunction and have the matching declaration file. All this feeds into webpack, which could take care of the module compatibility issues later.
But the import statement is just omitted completely
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug