Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we exlude some folder in the root src folder when running ng build

In my application generated by angular-cli there is angular-cli.json file which control ng operations.

But how do we exclude some folder inside src which is specified in the root?

"apps": [{
        "root": "src",
        "outDir": "dist",
        "assets": [
            "assets",
            "favicon.ico"
        ],
        "index": "index.html",
        "main": "main.ts",
        "polyfills": "polyfills.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.app.json",
        "testTsconfig": "tsconfig.spec.json",
        "prefix": "app",
        "styles": [
            "styles.css"
        ],
        "scripts": [],
        "environmentSource": "environments/environment.ts",
        "environments": {
            "dev": "environments/environment.ts",
            "prod": "environments/environment.prod.ts"
        }
    }],

Im thinking to add something like "exclude": [ "folder_name1", "folder_name1" ] but i cannot find any solution that agree in this.

like image 362
Roel Avatar asked Jun 12 '17 07:06

Roel


1 Answers

ng-build will run tsc to compile target files, you can add exclude settings into tsconfig.app.json to exclude some specific files or folder.

{
  "compilerOptions": {
    ...
  },
  "exclude": [
    "folder"    // example
  ]
}
like image 124
Pengyy Avatar answered Oct 04 '22 08:10

Pengyy