在哪里指定delete-output-path? [英] Where to specify delete-output-path?

查看:99
本文介绍了在哪里指定delete-output-path?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过Angular CLI添加了Angular的Node Express项目,即ng new.

I have a Node Express project with Angular added through Angular CLI, ie ng new.

我不希望Angular输出清除分发文件夹.

I do not want the Angular output to wipe out the distribution folder.

我知道可以在命令行上将delete-output-path参数放在ng build上.

I understand there is a delete-output-path parameter that can be put on the command line to ng build.

是否可以将其放在 angular-cli.json 中?

Is it possible to put this in angular-cli.json?

还是应该在 tsconfig.json 中?在哪个属性下?

Or should it be in tsconfig.json? Under which property?

推荐答案

是的,可以.您必须将其放在.angular-cli.json的defaults属性下,如下所示:

Yes, you can. You have to put it under defaults property of .angular-cli.json like this:

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "project-name"
  },
  "apps": [
    {// app property values here}

  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "component": {},
    "serve": {
      "port": 3000
    },
    "build": {
      "deleteOutputPath": false
    }
  }
}

如果您想了解有关此文件结构的更多信息,可以在这里此处

If you want to learn more about this file's structure, you can go here

希望它会有所帮助:)

这篇关于在哪里指定delete-output-path?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆