question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:8

github_iconTop GitHub Comments

1reaction
alan-agius4commented, May 28, 2020

Hi all,

Since version 9.1 of the Angular CLI we automatically ignore node_modules when polling. See #16153 for more details.

Therefore, this request should no longer be required. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue.

Thanks.

0reactions
angular-automatic-lock-bot[bot]commented, Jun 28, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Watch and WatchOptions | webpack
If you use require.context , webpack will watch your entire directory. You will need to ignore files and/or directories so that unwanted changes...
Read more >
Webpack watchOptions.ignored – exclude certain directories ...
I was trying to exclude all folder that does not have /src/ . I tried negative on glob pattern, which did not work....
Read more >
Watch and WatchOptions - webpack 3 documentation
webpack can watch files and recompile whenever they change. This page explains how to enable this and a couple of tweaks you can...
Read more >
Browsersync options
Browsersync options. These are all the options that you can configure when using Browsersync. Create a single object and pass it as the...
Read more >
webpack-dev-server - npm
-t, --target <value...> Sets the build target e.g. node. --no-target Negative 'target' option. --watch-options-stdin Stop watching when stdin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found