From 6e691b1de551dfa92aa5f8a7a22c4870ce1b1f09 Mon Sep 17 00:00:00 2001 From: Sam Bradley Date: Fri, 16 Jun 2023 16:31:43 +0800 Subject: [PATCH 1/2] AUS-3948 Fixed --- .gitignore | 2 +- angular.json | 32 +++++++++++++++----------------- package.json | 6 +++--- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index cc16ecfe9..9664f5912 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ # IDE - VSCode .vscode/* -!.vscode/settings.json +.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json diff --git a/angular.json b/angular.json index d8ffcba8c..27dbe2ba3 100644 --- a/angular.json +++ b/angular.json @@ -23,6 +23,20 @@ "index": "src/index.html", "main": "src/main.ts", "tsConfig": "src/tsconfig.app.json", + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "optimization": { + "scripts": true, + "styles": { + "minify": true, + "inlineCritical": true + }, + "fonts": true + }, + "buildOptimizer": false, "polyfills": "src/polyfills.ts", "assets": [ "src/contexts", @@ -84,14 +98,6 @@ "maximumWarning": "20kb" } ], - "optimization": false, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", @@ -103,17 +109,9 @@ "budgets": [ { "type": "anyComponentStyle", - "maximumWarning": "20kb" + "maximumWarning": "50kb" } ], - "optimization": false, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", diff --git a/package.json b/package.json index c883807fb..8a3d66e6c 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "ng": "ng", "start": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng serve", "build": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build", - "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration production --configuration=production", - "build-test": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration production --configuration=au2", - "build-dev": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration production --configuration=audev", + "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration=production", + "build-test": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration=au2", + "build-dev": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration=audev", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", From 788816e4c0a678e06235fcaa1f287db439f9c385 Mon Sep 17 00:00:00 2001 From: Sam Bradley Date: Mon, 19 Jun 2023 12:09:45 +0800 Subject: [PATCH 2/2] also exclude scripts from optimisation --- angular.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/angular.json b/angular.json index 27dbe2ba3..4d30e4215 100644 --- a/angular.json +++ b/angular.json @@ -2,9 +2,7 @@ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "cli": { "analytics": false, - "schematicCollections": [ - "@angular-eslint/schematics" - ] + "schematicCollections": ["@angular-eslint/schematics"] }, "version": 1, "newProjectRoot": "projects", @@ -29,7 +27,7 @@ "extractLicenses": true, "vendorChunk": false, "optimization": { - "scripts": true, + "scripts": false, "styles": { "minify": true, "inlineCritical": true @@ -194,10 +192,7 @@ "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": [ - "src/**/*.ts", - "src/**/*.html" - ] + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] } } }