Angular-cli: [Feature request]: allow specifying different tsconfig.app.json via command line, and/or have a different tsconfig for 'serve' and 'build' tasks

Created on 16 Jan 2018  路  5Comments  路  Source: angular/angular-cli

Currently I include some additional external ts files by way of the tsconfig.json 'include' property but I only need to include these in development builds / when using ng serve. It would be nice to be able to specify a separate tsconfig for production builds, similar to the way there is a separate tsconfig for tests.

devkibuild-angular feature

Most helpful comment

I'm looking for the same feature. I want to change the path for libs so that ng serve takes it from projects while ng build is taking it from dist folder.

All 5 comments

I'm looking for the same feature. I want to change the path for libs so that ng serve takes it from projects while ng build is taking it from dist folder.

@sten82 same issue here... did you figure out a workaround? Looking at it atm.

I want it to have a "modern build" feature - create es2015 build for modern browsers and es5 for legacy.

Hi,

You can achieve the above by having various build configurations and specifying a tsConfig in each.

Example:

"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    ...
    "tsConfig": "src/tsconfig.app.dev.json"
  },
  "configurations": {
    "production": {
      ...
      "tsConfig": "src/tsconfig.app.prod.json"
    }
}

ng serve will use the development tsconfig while when using the --prod flag it will use the production one.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings