nav tabs on admin dashboard
This commit is contained in:
33
node_modules/webpack/lib/DllPlugin.js
generated
vendored
33
node_modules/webpack/lib/DllPlugin.js
generated
vendored
@@ -8,30 +8,41 @@ const DllEntryPlugin = require("./DllEntryPlugin");
|
||||
const LibManifestPlugin = require("./LibManifestPlugin");
|
||||
const FlagInitialModulesAsUsedPlugin = require("./FlagInitialModulesAsUsedPlugin");
|
||||
|
||||
const validateOptions = require("schema-utils");
|
||||
const schema = require("../schemas/plugins/DllPlugin.json");
|
||||
|
||||
/** @typedef {import("../declarations/plugins/DllPlugin").DllPluginOptions} DllPluginOptions */
|
||||
|
||||
class DllPlugin {
|
||||
/**
|
||||
* @param {DllPluginOptions} options options object
|
||||
*/
|
||||
constructor(options) {
|
||||
validateOptions(schema, options, "Dll Plugin");
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.plugin("entry-option", (context, entry) => {
|
||||
function itemToPlugin(item, name) {
|
||||
if(Array.isArray(item))
|
||||
compiler.hooks.entryOption.tap("DllPlugin", (context, entry) => {
|
||||
const itemToPlugin = (item, name) => {
|
||||
if (Array.isArray(item)) {
|
||||
return new DllEntryPlugin(context, item, name);
|
||||
else
|
||||
throw new Error("DllPlugin: supply an Array as entry");
|
||||
}
|
||||
if(typeof entry === "object" && !Array.isArray(entry)) {
|
||||
}
|
||||
throw new Error("DllPlugin: supply an Array as entry");
|
||||
};
|
||||
if (typeof entry === "object" && !Array.isArray(entry)) {
|
||||
Object.keys(entry).forEach(name => {
|
||||
compiler.apply(itemToPlugin(entry[name], name));
|
||||
itemToPlugin(entry[name], name).apply(compiler);
|
||||
});
|
||||
} else {
|
||||
compiler.apply(itemToPlugin(entry, "main"));
|
||||
itemToPlugin(entry, "main").apply(compiler);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
compiler.apply(new LibManifestPlugin(this.options));
|
||||
compiler.apply(new FlagInitialModulesAsUsedPlugin());
|
||||
new LibManifestPlugin(this.options).apply(compiler);
|
||||
if (!this.options.entryOnly) {
|
||||
new FlagInitialModulesAsUsedPlugin("DllPlugin").apply(compiler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user