Skip to content

Commit

Permalink
build: disable production build optimization for NestJS
Browse files Browse the repository at this point in the history
disabled optimization in prod builds as this uses minification, which causes class names to change.
NestJS heavilty utilizes reflection for many features which break when this change occurs.

see nrwl/nx#8446
closes #4061
closes #4036
  • Loading branch information
bilalshaikh42 committed Jan 16, 2022
1 parent 757c150 commit 929a86f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 28 deletions.
30 changes: 22 additions & 8 deletions apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"outputPath": "dist/apps/api",
"main": "apps/api/src/main.ts",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": ["apps/api/src/assets"]
"assets": [
"apps/api/src/assets"
]
},
"configurations": {
"production": {
"optimization": true,
"optimization": false,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
Expand All @@ -38,7 +40,9 @@
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/api/**/*.ts"]
"lintFilePatterns": [
"apps/api/**/*.ts"
]
}
},
"test": {
Expand All @@ -53,7 +57,9 @@
"options": {
"file": "./Dockerfile",
"push": true,
"build-args": ["app=api"],
"build-args": [
"app=api"
],
"cache-from": [
"type=registry,ref=ghcr.io/biosimulations/api:buildcache"
],
Expand All @@ -62,7 +68,9 @@
],
"metadata": {
"enabled": true,
"images": ["ghcr.io/biosimulations/api"],
"images": [
"ghcr.io/biosimulations/api"
],
"labels": [
"org.opencontainers.image.title=BioSimulations API",
"org.opencontainers.image.description=Docker image for the BioSimulations API",
Expand All @@ -85,6 +93,12 @@
}
}
},
"tags": ["scope:dispatch", "type:api", "platform:server"],
"implicitDependencies": ["hdf5-api-client"]
}
"tags": [
"scope:dispatch",
"type:api",
"platform:server"
],
"implicitDependencies": [
"hdf5-api-client"
]
}
22 changes: 16 additions & 6 deletions apps/dispatch-service/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"outputPath": "dist/apps/dispatch-service",
"main": "apps/dispatch-service/src/main.ts",
"tsConfig": "apps/dispatch-service/tsconfig.app.json",
"assets": ["apps/dispatch-service/src/assets"]
"assets": [
"apps/dispatch-service/src/assets"
]
},
"configurations": {
"production": {
"optimization": true,
"optimization": false,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
Expand All @@ -38,7 +40,9 @@
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/dispatch-service/**/*.ts"]
"lintFilePatterns": [
"apps/dispatch-service/**/*.ts"
]
}
},
"test": {
Expand All @@ -53,7 +57,9 @@
"options": {
"file": "./Dockerfile",
"push": true,
"build-args": ["app=dispatch-service"],
"build-args": [
"app=dispatch-service"
],
"cache-from": [
"type=registry,ref=ghcr.io/biosimulations/simulation-service:buildcache"
],
Expand Down Expand Up @@ -88,6 +94,10 @@
}
}
},
"tags": ["scope:dispatch", "type:service", "platform:server"],
"tags": [
"scope:dispatch",
"type:service",
"platform:server"
],
"implicitDependencies": []
}
}
26 changes: 19 additions & 7 deletions apps/mail-service/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"outputPath": "dist/apps/mail-service",
"main": "apps/mail-service/src/main.ts",
"tsConfig": "apps/mail-service/tsconfig.app.json",
"assets": ["apps/mail-service/src/assets"]
"assets": [
"apps/mail-service/src/assets"
]
},
"configurations": {
"production": {
"optimization": true,
"optimization": false,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
Expand All @@ -36,7 +38,9 @@
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/mail-service/**/*.ts"]
"lintFilePatterns": [
"apps/mail-service/**/*.ts"
]
}
},
"test": {
Expand All @@ -51,7 +55,9 @@
"options": {
"file": "./Dockerfile",
"push": true,
"build-args": ["app=mail-service"],
"build-args": [
"app=mail-service"
],
"cache-from": [
"type=registry,ref=ghcr.io/biosimulations/mail-service:buildcache"
],
Expand All @@ -60,7 +66,9 @@
],
"metadata": {
"enabled": true,
"images": ["ghcr.io/biosimulations/mail-service"],
"images": [
"ghcr.io/biosimulations/mail-service"
],
"labels": [
"org.opencontainers.image.title=BioSimulations Mail Service",
"org.opencontainers.image.description=Docker image for the BioSimulations Mail Service",
Expand All @@ -83,5 +91,9 @@
}
}
},
"tags": ["scope:mail", "type:service", "platform:server"]
}
"tags": [
"scope:mail",
"type:service",
"platform:server"
]
}
26 changes: 19 additions & 7 deletions apps/simulators-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"outputPath": "dist/apps/simulators-api",
"main": "apps/simulators-api/src/main.ts",
"tsConfig": "apps/simulators-api/tsconfig.app.json",
"assets": ["apps/simulators-api/src/assets"]
"assets": [
"apps/simulators-api/src/assets"
]
},
"configurations": {
"production": {
"optimization": true,
"optimization": false,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
Expand All @@ -36,7 +38,9 @@
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/simulators-api/**/*.ts"]
"lintFilePatterns": [
"apps/simulators-api/**/*.ts"
]
}
},
"test": {
Expand All @@ -51,7 +55,9 @@
"options": {
"file": "./Dockerfile",
"push": true,
"build-args": ["app=simulators-api"],
"build-args": [
"app=simulators-api"
],
"cache-from": [
"type=registry,ref=ghcr.io/biosimulations/simulators-api:buildcache"
],
Expand All @@ -60,7 +66,9 @@
],
"metadata": {
"enabled": true,
"images": ["ghcr.io/biosimulations/simulators-api"],
"images": [
"ghcr.io/biosimulations/simulators-api"
],
"tags": [
"type=schedule",
"type=ref,event=branch",
Expand All @@ -83,5 +91,9 @@
}
}
},
"tags": ["scope:simulators", "type:api", "platform:server"]
}
"tags": [
"scope:simulators",
"type:api",
"platform:server"
]
}

0 comments on commit 929a86f

Please sign in to comment.