Skip to content

Commit b6becb4

Browse files
author
kingdaro
committed
refactor(removed plugin errors): take object as first parameter
1 parent 55392f2 commit b6becb4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/webpack.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ exportPlugins(exports.debug = {}, {
133133
"ProfilingPlugin": () => require("./debug/ProfilingPlugin"),
134134
});
135135

136-
const defineMissingPluginError = (pluginName, errorMessage) => {
137-
Reflect.defineProperty(exports.optimize, pluginName, {
136+
const defineMissingPluginError = (namespace, pluginName, errorMessage) => {
137+
Reflect.defineProperty(namespace, pluginName, {
138138
configurable: false,
139139
enumerable: true,
140140
get() {
@@ -145,12 +145,14 @@ const defineMissingPluginError = (pluginName, errorMessage) => {
145145

146146
// TODO remove in webpack 5
147147
defineMissingPluginError(
148+
exports.optimize,
148149
"UglifyJsPlugin",
149150
"webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead."
150151
);
151152

152153
// TODO remove in webpack 5
153154
defineMissingPluginError(
155+
exports.optimize,
154156
"CommonsChunkPlugin",
155157
"webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead."
156158
);

0 commit comments

Comments
 (0)