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.

watchOptions.ignored RegExp doesn't seem to work in Webpack 5

See original GitHub issue

Bug report

What is the current behavior? Files matching RegExp set to watchOptions.ignored is not ignored and triggers rebuilds.

If the current behavior is a bug, please provide the steps to reproduce. Clone this repo: https://github.com/JonWallsten/monorepo-new/tree/webpack-5-issue Start dev server as instructed in README.md Change file ignored.ts

What is the expected behavior? Changing files matching the pattern in watchOptions.ignored should not trigger a rebuild.

Other relevant information: webpack version: 5.12.3 webpack-cli version: 4.3.1 webpack-dev-server version: 3.11.1 Node.js version: 14.15.1 Operating System: Windows 10 Additional tools: Angular

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
alexander-akaitcommented, Jan 11, 2021

Found problem, move watchOptions to devServer.watchOptions, old version of webpack-dev-middelware (v3) is not respect global watchOptions configuration, it is fixed in v4 (https://github.com/webpack/webpack-dev-middleware/blob/master/src/index.js#L57), but we are still working on updating webpack-dev-server

1reaction
alexander-akaitcommented, Jan 11, 2021

I can’t reproduce, all works fine on linux (ubuntu) reproduced

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Module | webpack - JS.ORG
Prevent webpack from parsing any files matching the given regular expression(s). Ignored files should not have calls to import , require , define...
Read more >
TerserWebpackPlugin | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module...
Read more >
DevServer - webpack
By default it will use your current working directory to serve content. To disable contentBase set it to false . webpack.config.js module.exports =...
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