angular-cli: Build with --watch flag does not work with a lib project
Versions
Angular CLI: 6.0.7
Node: 9.6.1
OS: darwin x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.6.5
@angular-devkit/build-angular 0.6.5
@angular-devkit/build-ng-packagr 0.6.5
@angular-devkit/build-optimizer 0.6.5
@angular-devkit/core 0.6.5
@angular-devkit/schematics 0.6.5
@angular/cdk 6.1.0
@angular/cli 6.0.7
@angular/material 6.1.0
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.0.5
@schematics/angular 0.6.5
@schematics/update 0.6.7
ng-packagr 3.0.0
rxjs 6.2.0
typescript 2.7.2
webpack 4.8.3
Observed behavior
Running ng build --watch
works perfectly fine on the default app in a monorepo with the default app.
However, running ng build mylib --watch
or ng build --watch mylib
after generating a lib with the CLI gives Unknown option: '--watch'
Desired behavior
Can build any of the apps or libs in an Angular cli monorepo in --watch mode.
Mention any other details that might be useful (optional)
Have tried various combinations of ordering the arguments as well as --watch=true
and -w
. None seem to work.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 24
- Comments: 15
It’s working for me with:
However, if I make any changes in the lib, it reloads the page twice.
So they launch a new major version of the CLI breaking one of the commands? 😂
Watch mode works for these versions 😃
@angular-devkit
at0.8.0-rc.0
@angular
at6.1.4
ng-packagr
at4.1.0
sweet!
@bezysoftware you need to update all
@angular-devkit/<packages>
to0.8.0-beta.0
This should become available in Angular-CLI v6.2
On Wed, 25 Jul 2018 at 19:50, Jon notifications@github.com wrote:
Although it’s working for
--watch
now, it seems that no one of the other flags are working though, f.e.--output-path
or--delete-output-path
when using with a library. Im using Angular CLI 6.2.2. Can anyone else confirm this?You can use
Any idea on when this might be available? We are doing a lot of work with libs at the moment, no ability to watch is really rough…
That is a known error, if you are trying to change a file that is not part of the compilation.
https://github.com/dherges/ng-packagr/pull/1029
On Thu, 02 Aug 2018 at 14:02, Tomas Bezouska notifications@github.com wrote:
I installed the latest 6.2.0 beta.0, but am still unable to do
ng build --watch
for a library (“unknown switch”). Here’s outcome ofng --version
:Whats should I do?