📌  相关文章
📜  仅当“--module”标志设置为“es2020”、“esnext”、“commonjs”、“amd”、“system”或“umd”时才支持动态导入. - 打字稿代码示例

📅  最后修改于: 2022-03-11 14:48:19.946000             🧑  作者: Mango

代码示例1
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext", // add this line
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}