diff --git a/Makefile b/Makefile index 52d30505..c6385542 100644 --- a/Makefile +++ b/Makefile @@ -55,13 +55,16 @@ dep-frontend: .PHONY: build-frontend-sandbox build-frontend-sandbox: dep-frontend - cd frontend - yarn run build -- --configuration sandbox --output-path=../dist + cd frontend && yarn build -- -c sandbox .PHONY: build-frontend-prod build-frontend-prod: dep-frontend - cd frontend - yarn run build -- --configuration prod --output-path=../dist + cd frontend && yarn build -- -c prod + +.PHONY: build-frontend-desktop +build-frontend-desktop: dep-frontend + cd frontend && yarn build -- -c desktop + .PHONY: test-frontend # reduce logging, disable angular-cli analytics for ci environment diff --git a/frontend/angular.json b/frontend/angular.json index 0981dd86..338b99e2 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -126,6 +126,33 @@ "maximumError": "10kb" } ] + }, + "desktop": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.desktop.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "10mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] } } }, @@ -143,6 +170,9 @@ }, "cloud_sandbox": { "browserTarget": "fastenhealth:build:cloud_sandbox" + }, + "desktop": { + "browserTarget": "fastenhealth:build:desktop" } } }, diff --git a/frontend/package.json b/frontend/package.json index 7e2b7263..a8b1e97b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,7 @@ "ng": "ng", "start": "ng serve", "serve": "ng serve", - "build": "ng build", + "build": "ng build --output-path=../dist", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", diff --git a/frontend/src/environments/environment.desktop.ts b/frontend/src/environments/environment.desktop.ts new file mode 100644 index 00000000..17bdf4e5 --- /dev/null +++ b/frontend/src/environments/environment.desktop.ts @@ -0,0 +1,11 @@ +export const environment = { + production: true, + environment_cloud: false, + environment_name: "desktop", + + lighthouse_api_endpoint_base: 'https://lighthouse.fastenhealth.com/v1', + + + //used to specify the api server that we're going to use (can be relative or absolute). Must not have trailing slash + fasten_api_endpoint_base: '/api', +};