Does it work with webpack: true in nest-cli.json?
Not at runtime.
Answer
No, and this is architectural, not a fixable bug. Runtime discovery depends on require.cache, and webpack inlines everything into a single bundle: it never populates require.cache with an entry per original source file, which is what discovery depends on. Use npx nestjs-docfy patch-spec as a build step and serve the patched document via DocfyUiModule.setup({ staticSpecPath }). See Webpack + patch-spec.