Skip to content

Commit a39f2d3

Browse files
fix: re-export ModuleNotFoundError from lib/ModuleNotFoundError (#20988)
1 parent 16b799f commit a39f2d3

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": patch
3+
---
4+
5+
Re-export `ModuleNotFoundError` from `webpack/lib/ModuleNotFoundError` for backward compatibility with old plugins that import it from that path. This re-export will be removed in webpack 6.

lib/ModuleNotFoundError.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
5+
6+
"use strict";
7+
8+
// TODO remove in webpack 6
9+
// Some old plugins use `require("webpack/lib/ModuleNotFoundError")`, in webpack@6 developer should migrate to `compiler.webpack.ModuleNotFoundError`
10+
module.exports = require("./errors/ModuleNotFoundError");

0 commit comments

Comments
 (0)