-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support running nest with swc #17791
Comments
Any update? Would love to use it 👀 |
Any updates? I try use direct commands in |
Any updates? |
You can use this section in the docs to setup SWC. Unfortunately, you have to do it in every NestJS application. Basically, you just have to paste this code in your const { composePlugins, withNx } = require('@nx/webpack');
const swcDefaultConfig =
require('@nestjs/cli/lib/compiler/defaults/swc-defaults').swcDefaultsFactory()
.swcOptions;
module.exports = composePlugins(withNx(), (config) => {
config.module.rules.push({
test: /\.ts$/,
exclude: /node_modules/,
use: {
loader: 'swc-loader',
options: swcDefaultConfig,
},
});
return config;
});
Of course, make sure that you have the nestjs/cli installed locally in the project. EDIT: With further inspection, I'm actually not seeing any speed improvements with this fix. |
Probably related to: #8900 |
I think this does the trick: const { composePlugins, withNx } = require('@nx/webpack');
// Nx plugins for webpack.
module.exports = composePlugins(
withNx({
target: 'node',
compiler: 'swc',
}),
(config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
return config;
}
); |
For me, it is the same as the solution above, no speed improvement. |
Any updates?.. In my case I've tried few different ways yet still can't run nest with swc under nx. |
I would like to having this too 🙏🏻 |
Sorry for the late response. This should already be supported. Enabling it should be to change the If this does not work for you please feel free to open a new issue with a small repo! |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
Nest v10 release introduced the possibility to run nest with swc
See more: https://trilon.io/blog/nestjs-10-is-now-available#nestjs-%EF%B8%8F-swc
Motivation
Quicker development iterations than with tsc
The text was updated successfully, but these errors were encountered: