Skip to content

Allow disabling type-checking when swc-loader is used #2833

@christian-gama

Description

@christian-gama

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.

Screenshot 2024-12-04 at 09 01 42 Screenshot 2024-12-04 at 09 15 06

Minimum reproduction code

https://github.com/christian-gama/nestjs-build-bug-reproduction

Steps to reproduce

Local

  1. Run git clone https://github.com/christian-gama/nestjs-build-bug-reproduction.git
  2. Run cd nestjs-build-bug-reproduction.git
  3. Run pnpm install
  4. Run chmod +x ./entrypoint.sh
  5. Run ./entrypoint.sh
  6. Compare the build time with plugin enabled and plugin disabled

Docker

  1. Run git clone https://github.com/christian-gama/nestjs-build-bug-reproduction.git
  2. Run cd nestjs-build-bug-reproduction.git
  3. Run pnpm docker:build
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions