When setting ether the module
or target
property of the compiler options to esnext (id like to use import("example")
statements), es6 import statements stop working for npm install
ed librarys (local modules sill work: e.g. "./test.ts"
).
So this import * as asd from "testmodule";
throws cannot find module 'testmodule'
. However omitting both properies makes it work. Why is this and what es standard should I use to keep import("example")
and import * as asd from "testmodule";
statements?
Here is my full tsconfig.json:
{
"compilerOptions": {
"outDir": "./dist/",
"module": "esnext",
"target": "esnext",
"allowJs": true,
"sourceMap": true
}
}