feat: refactoring project
This commit is contained in:
14
node_modules/webpack/lib/library/ModernModuleLibraryPlugin.js
generated
vendored
14
node_modules/webpack/lib/library/ModernModuleLibraryPlugin.js
generated
vendored
@@ -16,6 +16,7 @@ const AbstractLibraryPlugin = require("./AbstractLibraryPlugin");
|
||||
/** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
/** @typedef {import("../Module")} Module */
|
||||
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
||||
/** @typedef {import("../javascript/JavascriptModulesPlugin").StartupRenderContext} StartupRenderContext */
|
||||
/** @typedef {import("../util/Hash")} Hash */
|
||||
/** @template T @typedef {import("./AbstractLibraryPlugin").LibraryContext<T>} LibraryContext<T> */
|
||||
@@ -46,9 +47,7 @@ class ModernModuleLibraryPlugin extends AbstractLibraryPlugin {
|
||||
compiler.hooks.compilation.tap("ModernModuleLibraryPlugin", compilation => {
|
||||
const { exportsDefinitions } =
|
||||
ConcatenatedModule.getCompilationHooks(compilation);
|
||||
exportsDefinitions.tap("ModernModuleLibraryPlugin", () => {
|
||||
return true;
|
||||
});
|
||||
exportsDefinitions.tap("ModernModuleLibraryPlugin", () => true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,8 +72,9 @@ class ModernModuleLibraryPlugin extends AbstractLibraryPlugin {
|
||||
`Library name must be unset. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
|
||||
);
|
||||
}
|
||||
const _name = /** @type {string} */ (name);
|
||||
return {
|
||||
name: /** @type {string} */ (name)
|
||||
name: _name
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,7 +93,9 @@ class ModernModuleLibraryPlugin extends AbstractLibraryPlugin {
|
||||
) {
|
||||
const result = new ConcatSource(source);
|
||||
const exportsInfo = moduleGraph.getExportsInfo(module);
|
||||
const definitions = module.buildMeta.exportsFinalName;
|
||||
const definitions =
|
||||
/** @type {BuildMeta} */
|
||||
(module.buildMeta).exportsFinalName;
|
||||
const exports = [];
|
||||
|
||||
for (const exportInfo of exportsInfo.orderedExports) {
|
||||
@@ -106,7 +108,7 @@ class ModernModuleLibraryPlugin extends AbstractLibraryPlugin {
|
||||
for (const reexportInfo of exp.orderedExports) {
|
||||
if (
|
||||
!reexportInfo.provided &&
|
||||
reexportInfo.name === reexport.export[0]
|
||||
reexportInfo.name === /** @type {string[]} */ (reexport.export)[0]
|
||||
) {
|
||||
shouldContinue = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user