feat: refactoring project
This commit is contained in:
44
node_modules/webpack/lib/index.js
generated
vendored
44
node_modules/webpack/lib/index.js
generated
vendored
@@ -71,9 +71,11 @@ const memoize = require("./util/memoize");
|
||||
const lazyFunction = factory => {
|
||||
const fac = memoize(factory);
|
||||
const f = /** @type {any} */ (
|
||||
(...args) => {
|
||||
return fac()(...args);
|
||||
}
|
||||
/**
|
||||
* @param {...any} args args
|
||||
* @returns {T} result
|
||||
*/
|
||||
(...args) => fac()(...args)
|
||||
);
|
||||
return /** @type {T} */ (f);
|
||||
};
|
||||
@@ -117,15 +119,24 @@ module.exports = mergeExports(fn, {
|
||||
get webpack() {
|
||||
return require("./webpack");
|
||||
},
|
||||
/**
|
||||
* @returns {function(Configuration | Configuration[]): void} validate fn
|
||||
*/
|
||||
get validate() {
|
||||
const webpackOptionsSchemaCheck = require("../schemas/WebpackOptions.check.js");
|
||||
const getRealValidate = memoize(() => {
|
||||
const validateSchema = require("./validateSchema");
|
||||
const webpackOptionsSchema = require("../schemas/WebpackOptions.json");
|
||||
return options => validateSchema(webpackOptionsSchema, options);
|
||||
});
|
||||
const getRealValidate = memoize(
|
||||
/**
|
||||
* @returns {function(Configuration | Configuration[]): void} validate fn
|
||||
*/
|
||||
() => {
|
||||
const validateSchema = require("./validateSchema");
|
||||
const webpackOptionsSchema = require("../schemas/WebpackOptions.json");
|
||||
return options => validateSchema(webpackOptionsSchema, options);
|
||||
}
|
||||
);
|
||||
return options => {
|
||||
if (!webpackOptionsSchemaCheck(options)) getRealValidate()(options);
|
||||
if (!webpackOptionsSchemaCheck(/** @type {TODO} */ (options)))
|
||||
getRealValidate()(options);
|
||||
};
|
||||
},
|
||||
get validateSchema() {
|
||||
@@ -479,6 +490,15 @@ module.exports = mergeExports(fn, {
|
||||
},
|
||||
get JsonpTemplatePlugin() {
|
||||
return require("./web/JsonpTemplatePlugin");
|
||||
},
|
||||
get CssLoadingRuntimeModule() {
|
||||
return require("./css/CssLoadingRuntimeModule");
|
||||
}
|
||||
},
|
||||
|
||||
esm: {
|
||||
get ModuleChunkLoadingRuntimeModule() {
|
||||
return require("./esm/ModuleChunkLoadingRuntimeModule");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -521,6 +541,12 @@ module.exports = mergeExports(fn, {
|
||||
}
|
||||
},
|
||||
|
||||
css: {
|
||||
get CssModulesPlugin() {
|
||||
return require("./css/CssModulesPlugin");
|
||||
}
|
||||
},
|
||||
|
||||
library: {
|
||||
get AbstractLibraryPlugin() {
|
||||
return require("./library/AbstractLibraryPlugin");
|
||||
|
||||
Reference in New Issue
Block a user