I have set up a new NestJS server via CLI. Then I installed the compression package via npm i --save compression.
My main.ts looks like this:
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as compression from 'compression';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(compression());
await app.listen(3000);
}
bootstrap();
Compare https://docs.nestjs.com/techniques/compression
Now when I start the project via nest start -b swc I get the following error message:
/test/src/main.ts:7
app.use(compression());
^
TypeError: _compression is not a function
at bootstrap (/test/src/main.ts:7:11)
How can I configure swc to allow the use of import * as ...?