Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NX + NestJS + webpack -> rspack = 🤷‍♂️ #30292

Open
3 of 4 tasks
rujorgensen opened this issue Mar 6, 2025 · 0 comments
Open
3 of 4 tasks

NX + NestJS + webpack -> rspack = 🤷‍♂️ #30292

rujorgensen opened this issue Mar 6, 2025 · 0 comments

Comments

@rujorgensen
Copy link

rujorgensen commented Mar 6, 2025

Current Behavior

Neither of the generators @nx/rspack:convert-config-to-rspack-plugin or @nx/rspack:convert-webpack converts the webpack configuration of a NestJS application to rspack.

Expected Behavior

I'd expect:

  1. A rspack.config.js configuration file to be generated inspired from the current webpack.config.js
  2. The build target of the converted application project to be updated to use the new rspack configuration
  3. The original webpack.config.js-file to be deleted

GitHub Repo

https://github.com/rujorgensen/nx-webpack-rspack-conf-issue

Steps to Reproduce

  1. Create a fresh workspace: npx create-nx-workspace nx-workspace --preset=nest --no-interactive
  2. Add @nx/rspack to the workspace: cd nx-workspace && nx add @nx/rspack
  3. Convert the webpack configuration to rspack:
    a. npx nx g @nx/rspack:convert-webpack --project=nx-workspace
    --OR--
    b. npx nx g @nx/rspack:convert-config-to-rspack-plugin --project=nx-workspace

Current result:
3.a. Completes without touching any files
3.b. Fails with "NX Could not find any projects to migrate."

Nx Report

Node           : 20.11.1
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 10.2.4

nx (global)            : 20.4.0
nx                     : 20.4.6
@nx/js                 : 20.4.6
@nx/jest               : 20.4.6
@nx/eslint             : 20.4.6
@nx/workspace          : 20.4.6
@nx/devkit             : 20.4.6
@nx/eslint-plugin      : 20.4.6
@nx/module-federation  : 20.4.6
@nx/nest               : 20.4.6
@nx/node               : 20.4.6
@nx/rspack             : 20.4.6
@nx/web                : 20.4.6
@nx/webpack            : 20.4.6
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/rspack/plugin

Failure Logs

 NX   Could not find any projects to migrate.

Package Manager Version

pnpm v. 9.10.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

(re-opening closed issue #29482)

@rujorgensen rujorgensen changed the title NX + NestJS + webpack -> rspack = 💣 NX + NestJS + webpack -> rspack = 🤷‍♂️ Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant