-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Command
build
Description
I'd like you to please reconsider #12487. Please support the --poll option for ng build in libraries.
Describe the solution you'd like
I'd like for the --poll option for ng build to work for libraries as it does for applications.
I stumbled across this issue because I'm running ng build --watch for a library in a Docker container on Windows using WSL2 and the watch mode does not work in my case due to:
In cases where Angular CLI is running in a shared directory on linux VM on a windows host the webpack dev server isn't detecting file changes from the host environment. (ex: Whenever a docker dev environment is running on a windows host.) This is solved by adding poll option to the webpack dev server configuration. By default when no poll interval is set watchpack will use native file system change detection. This change allows for setting the poll interval which will turn on polling. 1
Note
At least consider adding some note to the ng build docs about this since it took me a while to understand why I kept getting "argument not supported" when using an option that the docs say is available for ng build.
Describe alternatives you've considered
Since the --watch option doesn't work for my case, I've been relying on the use of the --poll option, usually with ng serve. However, now I want to use the --poll with ng build for a library and this doesn't work.
The only workarounds I'm left are:
For some reason nodemon and webpack-dev-server hot reload does not work in WSL2. Downgrading to WSL 1 resolved the issue.
In order for this to work in WSL 2, the project needs to be inside the linux file system. 2