Skip to content

Feature request to expose Webpack watchOptions.ignored for the build command #12313

@grantlucas

Description

@grantlucas

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.2.2
Node: 8.12.0
OS: linux x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.3
@angular-devkit/build-angular     0.8.3
@angular-devkit/build-optimizer   0.8.3
@angular-devkit/build-webpack     0.8.3
@angular-devkit/core              0.8.3
@angular-devkit/schematics        0.8.2
@angular/cli                      6.2.2
@ngtools/webpack                  6.2.3
@schematics/angular               0.8.2
@schematics/update                0.8.2
rxjs                              6.3.2
typescript                        2.9.2
webpack                           4.19.1

Repro steps

N/A

The log given by the failure

N/A

Desired functionality

The ability to set Webpack's watchOptions.ignored is greatly needed in order to run an Angular application properly within a Vagrant setup. As it is right now, with the --poll option set, CPU usage hovers around 80-90% while watching files. In all other Webpack setups I have running within Vagrant, I've always ignored node_modules with great success.

In my initial local testing I altered the watch options the build command uses to set ignored to /node_modules/. After the changes, my VM's CPUs hovered around 5% usage. This showed that this could resolve my issue if that option's exposed.

Mention any other details that might be useful

I've tried the following with little to no success:

  • Using nice to reduce priority
  • Increasing the poll time up to 5 seconds
  • A combination of both nice and increased poll time

With a slow poll time, and nice, I was able to reduce CPU usage to about 60% but this was still vastly more than the 5% average I was seeing after adding node_modules to the ignored list.

My typical watch options

        watchOptions: {
            ignored: /node_modules/,
            aggregateTimeout: 300,
            poll: 1000
        },

Any help with this would be greatly appreciated.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions