Closed p-v-d-Veeken closed 10 months ago
@antoinepairet seems bundle nestjs successfully, and we have an example https://github.com/web-infra-dev/rspack/blob/main/examples/nestjs/rspack.config.js which bundles most of the library in node_modules, but it seems there're still some problems with Nestjs itself and other library, I'm not sure whether it could bundle all third party libraries because it mostly depends on third party library implementation. so if you successfully bundle it with webpack and find problems on rspack, it's mostly rspack's bug | missing features, but if you can't bundle it successfully with webpack it may be not a easy rspack to do the same thing.
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
System Info
System: OS: macOS 13.5.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 440.11 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.1/bin/yarn npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm pnpm: 8.9.0 - ~/.nvm/versions/node/v18.17.1/bin/pnpm Watchman: 2023.08.07.00 - /usr/local/bin/watchman Browsers: Chrome: 117.0.5938.149 Safari: 16.6 npmPackages: @rspack/core: ~0.3.6 => 0.3.6 @rspack/dev-server: ~0.3.6 => 0.3.6 @rspack/plugin-minify: ~0.3.6 => 0.3.6
Details
I've set up a basic NestJS + RSPack repo and when building the app, the resulting main.js does not include the necessary @nestjs/* dependencies. This means, that the bundle can only be executed if the corresponding node_modules are available. Which kind of defeats the purpose of using a bundler.
Reproduce link
https://github.com/p-v-d-Veeken/nest-rspack
Reproduce Steps
npm install
nx build demo
node dist/apps/demo/main.js
this will output:mv node_modules node_modules.tmp
node dist/apps/demo/main.js
again, this time it will output:Error: Cannot find module '@nestjs/common' Require stack: