xch-jiang

更改 tsconfig.json 文件中的配置项:
tsconfig.json 文件是由 tsc --init 命令生成的,参考:TypeScript 配置文件 - tsconfig.json

{
  "compilerOptions": {
    "module": "amd",
    "outFile": "./build/page.js",
    "rootDir": "./src"
  }
}

可以通过 "rootDir": "./src" 指定 ts 文件的目录。
原来是 "module":"commonjs",需要改成 "module": "amd"。amd 是一种模块化规范。


相关文章:
TypeScript 配置文件 - tsconfig.json

分类:

技术点:

相关文章: