GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix issue when contextRegExp is undefined · webpack/webpack@6c22ca2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • IgnorePlugin.js
  • test/configCases/errors/multi-entry-missing-module
    • webpack.config.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/IgnorePlugin.js‎

Copy file name to clipboardExpand all lines: lib/IgnorePlugin.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ class IgnorePlugin {
4040
checkIgnore(result) {
4141
if (
4242
"checkResource" in this.options &&
43+
this.options.checkResource &&
4344
this.options.checkResource(result.request, result.context)
4445
) {
4546
// TODO webpack 5 remove checkContext, as checkResource already gets context
46-
if ("checkContext" in this.options) {
47+
if ("checkContext" in this.options && this.options.checkContext) {
4748
if (this.options.checkContext(result.context)) {
4849
return null;
4950
}
@@ -54,9 +55,10 @@ class IgnorePlugin {
5455

5556
if (
5657
"resourceRegExp" in this.options &&
58+
this.options.resourceRegExp &&
5759
this.options.resourceRegExp.test(result.request)
5860
) {
59-
if ("contextRegExp" in this.options) {
61+
if ("contextRegExp" in this.options && this.options.contextRegExp) {
6062
// if "contextRegExp" is given,
6163
// both the "resourceRegExp" and "contextRegExp" have to match.
6264
if (this.options.contextRegExp.test(result.context)) {
Collapse file

‎test/configCases/errors/multi-entry-missing-module/webpack.config.js‎

Copy file name to clipboardExpand all lines: test/configCases/errors/multi-entry-missing-module/webpack.config.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ module.exports = {
88
filename: "[name].js"
99
},
1010
plugins: [
11-
new IgnorePlugin({
12-
resourceRegExp: new RegExp(/intentionally-missing-module/)
13-
})
11+
new IgnorePlugin(/intentionally-missing-module/)
1412
],
1513
node: {
1614
__dirname: false

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.