feat: refactoring project
This commit is contained in:
16
node_modules/webpack/lib/DllPlugin.js
generated
vendored
16
node_modules/webpack/lib/DllPlugin.js
generated
vendored
@@ -12,6 +12,8 @@ const createSchemaValidation = require("./util/create-schema-validation");
|
||||
|
||||
/** @typedef {import("../declarations/plugins/DllPlugin").DllPluginOptions} DllPluginOptions */
|
||||
/** @typedef {import("./Compiler")} Compiler */
|
||||
/** @typedef {import("./DllEntryPlugin").Entries} Entries */
|
||||
/** @typedef {import("./DllEntryPlugin").Options} Options */
|
||||
|
||||
const validate = createSchemaValidation(
|
||||
require("../schemas/plugins/DllPlugin.check.js"),
|
||||
@@ -43,13 +45,13 @@ class DllPlugin {
|
||||
compiler.hooks.entryOption.tap("DllPlugin", (context, entry) => {
|
||||
if (typeof entry !== "function") {
|
||||
for (const name of Object.keys(entry)) {
|
||||
const options = {
|
||||
name,
|
||||
filename: entry.filename
|
||||
};
|
||||
new DllEntryPlugin(context, entry[name].import, options).apply(
|
||||
compiler
|
||||
);
|
||||
/** @type {Options} */
|
||||
const options = { name, filename: entry.filename };
|
||||
new DllEntryPlugin(
|
||||
context,
|
||||
/** @type {Entries} */ (entry[name].import),
|
||||
options
|
||||
).apply(compiler);
|
||||
}
|
||||
} else {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user