feat: refactoring project
This commit is contained in:
8
node_modules/webpack/lib/ProvidePlugin.js
generated
vendored
8
node_modules/webpack/lib/ProvidePlugin.js
generated
vendored
@@ -58,16 +58,16 @@ class ProvidePlugin {
|
||||
* @returns {void}
|
||||
*/
|
||||
const handler = (parser, parserOptions) => {
|
||||
Object.keys(definitions).forEach(name => {
|
||||
for (const name of Object.keys(definitions)) {
|
||||
const request =
|
||||
/** @type {string[]} */
|
||||
([]).concat(definitions[name]);
|
||||
const splittedName = name.split(".");
|
||||
if (splittedName.length > 0) {
|
||||
splittedName.slice(1).forEach((_, i) => {
|
||||
for (const [i, _] of splittedName.slice(1).entries()) {
|
||||
const name = splittedName.slice(0, i + 1).join(".");
|
||||
parser.hooks.canRename.for(name).tap(PLUGIN_NAME, approve);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
parser.hooks.expression.for(name).tap(PLUGIN_NAME, expr => {
|
||||
@@ -100,7 +100,7 @@ class ProvidePlugin {
|
||||
parser.walkExpressions(expr.arguments);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
normalModuleFactory.hooks.parser
|
||||
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
|
||||
|
||||
Reference in New Issue
Block a user