Angular-cli: ng serve no longer has --preserve-symlinks

Created on 17 May 2018  路  5Comments  路  Source: angular/angular-cli

I've created a new Angular 6 app with Angular CLI. I'm using a symlinked directory in Windows, so to compile I must use ng build --preserve-symlinks . This is all fine.

However, ng serve no longer has a --preserve-symlinks option, so it fails rather miserably (pretty mush like ng build fails without the switch. This makes version 6 of @angular/cli quite unusable to us.

Versions

Angular CLI: 6.0.3
Node: 8.11.2
OS: win32 x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cli                      6.0.3
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3

Repro steps

ng serve --preserve-symlinks

Observed behavior

Unknown option: '--preserveSymlinks'

Desired behavior

It should work, like it did in previous versions.

Most helpful comment

I think it should still be on the command line. I don't want to perserve symlinks on a CI server or on a typical build, but only when I am working on another package (outside of Angular) that this needs to use

All 5 comments

Heya, that option is only available on build now. You can set it there and it will be a used in all builds, including when serving:

"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
      "preserveSymlinks": true,

This works, thanks.

However, there needs to be some sort of documentation for this. I couldn't even find the document to the angular.json file.

There is a document about what options that file has in https://github.com/angular/angular-cli/wiki/angular-workspace. I agree it's not great, but it does exist. Some editors (like VSCode) will also give you autocompletion with descriptions when editing the file.

I think it should still be on the command line. I don't want to perserve symlinks on a CI server or on a typical build, but only when I am working on another package (outside of Angular) that this needs to use

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