Skip to content

Commit

Permalink
Add deployment angular environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ClFeSc authored and anonym-HPI committed Apr 6, 2022
1 parent b392c50 commit 5bc8bad
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/building.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ COPY ./ /usr/local/app/
RUN npm run setup

# Generate the build of the application
RUN npm run build
RUN npm run build:deployment
21 changes: 21 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,27 @@
],
"outputHashing": "all"
},
"deployment": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.deployment.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build:deployment": "ng build --configuration deployment",
"watch": "ng build --watch --configuration development",
"lint": "eslint --max-warnings 0 --ignore-path .gitignore \"./**/*.{ts,js,yml,css,sccs,html,angular}\"",
"lint:fix": "eslint --ignore-path .gitignore --fix \"./**/*.{ts,js,yml,css,sccs,html,angular}\"",
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/environments/environment.deployment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Environment } from './environment-type';

export const environment: Environment = {
production: true,
httpPort: 80,
websocketPort: 3200,
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"scripts": {
"build": "cd shared && npm run build && cd .. && concurrently \"cd frontend && npm run build\" \"cd backend && npm run build\"",
"build:deployment": "cd shared && npm run build && cd .. && cd frontend && npm run build:deployment && cd ../backend && npm run build",
"start:all": "(cd frontend && npm run start) & (cd backend && npm run start)",
"cy:ci": "cd frontend && npm run cy:run",
"install:all": "npm i && concurrently \"cd shared && npm i\" \"cd frontend && npm i\" \"cd backend && npm i\"",
Expand Down

0 comments on commit 5bc8bad

Please sign in to comment.