-
Notifications
You must be signed in to change notification settings - Fork 408
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
I have a monorepo project that uses webpack + swc-loader + @nestjs/swagger plugin. Everything runs fine and fast (build is around 100ms), however if I simply REMOVE the @nestjs/swagger plugin, build time increases to ~=2200ms for no reason.


Minimum reproduction code
https://github.com/christian-gama/nestjs-build-bug-reproduction
Steps to reproduce
Local
- Run
git clone https://github.com/christian-gama/nestjs-build-bug-reproduction.git
- Run
cd nestjs-build-bug-reproduction.git
- Run
pnpm install
- Run
chmod +x ./entrypoint.sh
- Run
./entrypoint.sh
- Compare the build time with plugin enabled and plugin disabled
Docker
- Run
git clone https://github.com/christian-gama/nestjs-build-bug-reproduction.git
- Run
cd nestjs-build-bug-reproduction.git
- Run
pnpm docker:build
- Compare the build time with plugin enabled and plugin disabled
Expected behavior
Disabling or enabling the @nestjs/swagger should have no impact in the build time of the application, but the weirdest behavior is to have a build time 10x faster with the plugin ENABLED, which does not make any sense, since swc-loader does not even support the @nest/swagger plugin.
I'd like to see a faster build time without using the @nest/swagger plugin enabled - the only thing this plugin is doing for the project is to improve the build time, which shouldn't be happening.
Package
- I don't know. Or some 3rd-party package
-
@nestjs/common
-
@nestjs/core
-
@nestjs/microservices
-
@nestjs/platform-express
-
@nestjs/platform-fastify
-
@nestjs/platform-socket.io
-
@nestjs/platform-ws
-
@nestjs/testing
-
@nestjs/websockets
- Other (see below)
Other package
@nestjs/swagger
NestJS version
10.4.12
Packages versions
[System Information]
OS Version : macOS 24.1.0
NodeJS Version : v23.1.0
NPM Version : 10.9.0
[Nest CLI]
Nest CLI Version : 10.4.8
[Nest Platform Information]
platform-express version : 10.4.12
cache-manager version : 2.3.0
microservices version : 10.4.12
mapped-types version : 2.0.6
schematics version : 10.2.3
passport version : 10.0.3
schedule version : 4.1.1
terminus version : 10.2.3
swagger version : 8.0.7
testing version : 10.4.12
common version : 10.4.12
config version : 3.3.0
axios version : 3.1.2
core version : 10.4.12
cli version : 10.4.8
version : 2.4.2
version : 1.2.4
Node.js version
23.1.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response