angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

esbuild ng serve not watching files outside project root

Open gmfun opened this issue 3 years ago • 15 comments

Command

serve

Is this a regression?

  • [X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

v16.0.0-next.7

Description

Using nx workspace style project where app is in apps/some-app and it imports code from projects inside projects/some-project. When i use ng serve some-app with esbuild, changes in projects/some-project does not trigger reload.

The code in project/some-project is reference using tsconfig.json paths.

{
  "compilerOptions": {
       "paths": {
              "@org/some-project": ["projects/some-project/src/index.ts"]
       }
}

This used to work in v16.0.0-next.7 and with webpack based ng serve

Minimal Reproduction

  • create a new nx workspace
  • create an application
  • create a library
  • use the library in the application
  • run ng serve with esbuild for the application
  • make changes the the referenced library
  • reload is not triggered

Exception or Error

No response

Your Environment

v16.0.0-rc-0

Anything else relevant?

No response

gmfun avatar Apr 13 '23 05:04 gmfun

I have this problem, too, with Angular 16.0.0 (final release). All changes to Nx libs are complety ignored, even after an explicit reload.

esagawe avatar May 07 '23 16:05 esagawe

Also problem when using nx monorepo, when you change and code in libs, no rebuild / not watched. https://github.com/nrwl/nx/issues/16824

pumano avatar May 07 '23 18:05 pumano

That issue is blocker for migrating to esbuild

pumano avatar May 08 '23 18:05 pumano

Same, using nx and angular 16 release. More or less all code is in libraries in the monorepo, so not usable for dev in such scenarios...

atsjo avatar May 09 '23 14:05 atsjo

I also have same issue. I have paths mapping for internal design system, translate library. (monorepo scenario)

leo6104 avatar May 11 '23 14:05 leo6104

Also running into this with an Nx monorepo. Can confirm it does not work with stuff outside app dir but does for code within app dir.

yharaskrik avatar May 11 '23 18:05 yharaskrik

same issue here

Zwergenpunk avatar May 12 '23 13:05 Zwergenpunk

with each new version you break the basic functionalities. do you even test and/or use what you make?

ghost avatar May 17 '23 07:05 ghost

@dick2tick, the esbuilder is still experimental and thus it is not yet feature complete.

alan-agius4 avatar May 17 '23 09:05 alan-agius4

smart developer: I made a great car, the color is great, the comfort is great, everything is great; you can try it from v16 stupid developer: I can't start the car smart developer: it's still an experimental car stupid developer: ok, what's the point of a car!?!

ghost avatar May 17 '23 12:05 ghost

Currently the watcher adds the projectRoot and some package manager changes but nothing else. Would need the option to configure or auto detect based off compilerOptions > paths to unblock

https://github.com/angular/angular-cli/blob/77f21c1ba1e9864ef7a7aea3c4e84b8f6428f5d7/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts#L662

AdditionAddict avatar May 17 '23 15:05 AdditionAddict

Currently the watcher adds the projectRoot and some package manager changes but nothing else. Would need the option to configure or auto detect based off compilerOptions > paths to unblock

https://github.com/angular/angular-cli/blob/77f21c1ba1e9864ef7a7aea3c4e84b8f6428f5d7/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts#L662

This doesn't seem excessively complex to add, @clydin I assuming this is already in the works though and theres no need for a community PR for this?

yharaskrik avatar May 17 '23 15:05 yharaskrik

I test that feature, it's still not working. Watcher not checking tsconfig paths

pumano avatar May 27 '23 23:05 pumano

in 16.1 it works for .ts files, but still not for html or css in libraries...

atsjo avatar Jun 13 '23 23:06 atsjo

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.