Does anyone know how to enable nest-cli plugins in an nx monorepo?
The base apps generated by NX don't leverage nest-cli.json.
The nx configuration ends up looking something like this (you'll notice my attempt to get the swagger plugin to work).
I feel like this is a failing on the NX side of things, but perhaps there might be some guidance from NestJS folks here that might know of a way to enable this. I'm considering dropping the webpack executor and seeing if I can just run the nest-cli directly, but I might have to duplicate a lot of monorepo configuration for that to work, which isn't ideal.
{
"name": "ease-backend",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/ease-backend/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/ease-backend",
"main": "apps/ease-backend/src/main.ts",
"tsConfig": "apps/ease-backend/tsconfig.app.json",
"assets": ["apps/ease-backend/src/assets"],
"isolatedConfig": true,
"webpackConfig": "apps/ease-backend/webpack.config.js",
"transformers": [
{
"name": "@nestjs/swagger/plugin",
"options": {
"classValidatorShim": false,
"introspectComments": true
}
}
],
"generatePackageJson": true
},
"configurations": {
"development": {},
"production": {}
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "ease-backend:build"
},
"configurations": {
"development": {
"buildTarget": "ease-backend:build:development"
},
"production": {
"buildTarget": "ease-backend:build:production"
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/ease-backend/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/ease-backend/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": ["scope:server"]
}