Skip to content

Commit a658945

Browse files
committed
fix: If module.nameForCondition is missing, do nothing
It looks like not all modules have it so it could crash here.
1 parent 59e16a7 commit a658945

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/plugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ export default class DocgenPlugin implements webpack.WebpackPluginInstance {
185185

186186
// 1. Aggregate modules to process
187187
compilation.modules.forEach((module: webpack.Module) => {
188+
if (!module.nameForCondition) {
189+
return;
190+
}
191+
188192
const nameForCondition = module.nameForCondition() || "";
189193

190194
if (isExcluded(nameForCondition)) {

0 commit comments

Comments
 (0)