首页 > 解决方案 > 仅在保存时编译 Angular 项目

问题描述

目前,我的 Angular 项目会在保存时以及每当有代码更改时进行编译。我希望它只在保存时编译。

我的 tsconfig.json:

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

标签: jsonangular

解决方案


功能的转折autoSave

改变:

File > Preferences > Settings > Search autoSave > select off

更改后的用户设置:

"files.autoSave": "off",

推荐阅读