diff --git a/angular.json b/angular.json index aa91ea3..6b25303 100644 --- a/angular.json +++ b/angular.json @@ -113,12 +113,30 @@ "sourceMap": true, "outputPath": "dist/server", "tsConfig": "tsconfig.ssr.json", - "main": "prerender.ts", - "optimization": { - "styles": false, - "scripts": true + "main": "prerender.ts" + }, + "configurations": { + "development": { + "optimization": { + "styles": false, + "scripts": false + } + }, + "production": { + "outputHashing": "media", + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": { + "styles": false, + "scripts": true + } } - } + }, + "defaultConfiguration": "production" } } } diff --git a/package.json b/package.json index 32a525c..6680578 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,10 @@ "dev:prod": "ng serve --host 127.0.0.1 --port 4300 --configuration production", "start": "ng serve", "build": "ng build && ng run app:ssr && npm run prerender", - "build:ssr": "ng run app:ssr", + "build:ssr": "ng run app:ssr:production", "build:app": "ng build --configuration production", "build:app:dev": "ng build --configuration development", + "build:ssr:dev": "ng run app:ssr:development", "prerender": "node dist/server/main.js", "watch": "ng build --watch --configuration development", "postinstall": "cd webpack && npm install",