mirror of https://github.com/webpack/webpack.git
remove unneeded array
This commit is contained in:
parent
01b02e6e49
commit
dabbfa7c4e
|
|
@ -321,29 +321,27 @@ class ModuleConcatenationPlugin {
|
|||
}
|
||||
|
||||
getImports(module) {
|
||||
return Array.from(
|
||||
new Set(
|
||||
module.dependencies
|
||||
return new Set(
|
||||
module.dependencies
|
||||
|
||||
// Only harmony Dependencies
|
||||
.filter(dep => dep instanceof HarmonyImportDependency)
|
||||
// Get reference info only for harmony Dependencies
|
||||
.map(
|
||||
dep =>
|
||||
dep instanceof HarmonyImportDependency ? dep.getReference() : null
|
||||
)
|
||||
|
||||
// Get reference info for this dependency
|
||||
.map(dep => dep.getReference())
|
||||
// Reference is valid and has a module
|
||||
// Dependencies are simple enough to concat them
|
||||
.filter(
|
||||
ref =>
|
||||
ref &&
|
||||
ref.module &&
|
||||
(Array.isArray(ref.importedNames) ||
|
||||
Array.isArray(ref.module.buildMeta.providedExports))
|
||||
)
|
||||
|
||||
// Reference is valid and has a module
|
||||
.filter(ref => ref && ref.module)
|
||||
|
||||
// Dependencies are simple enough to concat them
|
||||
.filter(
|
||||
ref =>
|
||||
Array.isArray(ref.importedNames) ||
|
||||
Array.isArray(ref.module.buildMeta.providedExports)
|
||||
)
|
||||
|
||||
// Take the imported module
|
||||
.map(ref => ref.module)
|
||||
)
|
||||
// Take the imported module
|
||||
.map(ref => ref.module)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue