File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,6 +198,30 @@ export default class DocgenPlugin implements webpack.WebpackPluginInstance {
198198
199199 const nameForCondition = module . nameForCondition ( ) || "" ;
200200
201+ // Ignore already built modules for webpack 5
202+ if ( ! compilation . builtModules . has ( module ) ) {
203+ debugExclude ( `Ignoring un-built module: ${ nameForCondition } ` ) ;
204+ return ;
205+ }
206+
207+ // Ignore external modules
208+ // eslint-disable-next-line
209+ // @ts -ignore: Webpack 4 type
210+ if ( module . external ) {
211+ debugExclude ( `Ignoring external module: ${ nameForCondition } ` ) ;
212+ return ;
213+ }
214+
215+ // Ignore raw requests
216+ // eslint-disable-next-line
217+ // @ts -ignore: Webpack 4 type
218+ if ( ! module . rawRequest ) {
219+ debugExclude (
220+ `Ignoring module without "rawRequest": ${ nameForCondition } `
221+ ) ;
222+ return ;
223+ }
224+
201225 if ( isExcluded ( nameForCondition ) ) {
202226 debugExclude (
203227 `Module not matched in "exclude": ${ nameForCondition } `
You can’t perform that action at this time.
0 commit comments