feat: refactoring project
This commit is contained in:
7
node_modules/webpack/lib/APIPlugin.js
generated
vendored
7
node_modules/webpack/lib/APIPlugin.js
generated
vendored
@@ -144,6 +144,7 @@ class APIPlugin {
|
||||
constructor(options = {}) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the plugin
|
||||
* @param {Compiler} compiler the compiler instance
|
||||
@@ -213,7 +214,7 @@ class APIPlugin {
|
||||
* @param {JavascriptParser} parser the parser
|
||||
*/
|
||||
const handler = parser => {
|
||||
Object.keys(REPLACEMENTS).forEach(key => {
|
||||
for (const key of Object.keys(REPLACEMENTS)) {
|
||||
const info = REPLACEMENTS[key];
|
||||
parser.hooks.expression.for(key).tap(PLUGIN_NAME, expression => {
|
||||
const dep = toConstantDependency(parser, info.expr, info.req);
|
||||
@@ -237,7 +238,7 @@ class APIPlugin {
|
||||
.for(key)
|
||||
.tap(PLUGIN_NAME, evaluateToString(info.type));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
parser.hooks.expression
|
||||
.for("__webpack_layer__")
|
||||
@@ -277,7 +278,7 @@ class APIPlugin {
|
||||
(parser.state.module.buildInfo).moduleConcatenationBailout =
|
||||
"__webpack_module__.id";
|
||||
const dep = new ConstDependency(
|
||||
parser.state.module.moduleArgument + ".id",
|
||||
`${parser.state.module.moduleArgument}.id`,
|
||||
/** @type {Range} */ (expr.range),
|
||||
[RuntimeGlobals.moduleId]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user