From e501ac001c2494f6b33f8fa0b24ef21a76e9d65e Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Tue, 25 Apr 2023 12:16:20 -0400 Subject: [PATCH] chore: angular test apps serve in dev mode (#27270) Issue number: N/A --------- ## What is the current behavior? When adding the Angular 16 test infrastructure, I accidentally regressed ng14/ng15 test apps to run in production mode when serving locally. This resulted in slower serve time and the vendor code being code split, making it difficult to debug locally. ## What is the new behavior? - Angular test apps run in dev mode when served locally - Angular test apps run in prod mode when built with `npm run build` ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information We can share the same `angular.json` across all the major versions of Angular we currently support. --- angular/test/apps/ng16/angular.json | 156 ---------------------------- angular/test/base/angular.json | 22 ++-- 2 files changed, 16 insertions(+), 162 deletions(-) delete mode 100644 angular/test/apps/ng16/angular.json diff --git a/angular/test/apps/ng16/angular.json b/angular/test/apps/ng16/angular.json deleted file mode 100644 index 2d5b6774e3..0000000000 --- a/angular/test/apps/ng16/angular.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "test-app": { - "root": "", - "sourceRoot": "src", - "projectType": "application", - "prefix": "app", - "schematics": {}, - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/test-app/browser", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.app.json", - "buildOptimizer": true, - "assets": [ - "src/favicon.ico", - { - "glob": "**/*", - "input": "src/assets", - "output": "assets" - }, - { - "glob": "**/*.svg", - "input": "node_modules/ionicons/dist/ionicons/svg", - "output": "./svg" - } - ], - "styles": ["src/styles.css"], - "scripts": [] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "aot": true, - "progress": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb" - } - ] - }, - "development": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "test-app:build" - }, - "configurations": { - "production": { - "browserTarget": "test-app:build:production" - }, - "development": { - "browserTarget": "test-app:build:development" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "test-app:build" - } - }, - "lint": { - "builder": "@angular-eslint/builder:lint", - "options": { - "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] - } - }, - "server": { - "builder": "@angular-devkit/build-angular:server", - "options": { - "outputPath": "dist/test-app/server", - "main": "server.ts", - "tsConfig": "tsconfig.server.json" - }, - "configurations": { - "production": { - "outputHashing": "media", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "sourceMap": false, - "optimization": true - } - } - }, - "serve-ssr": { - "builder": "@nguniversal/builders:ssr-dev-server", - "options": { - "browserTarget": "test-app:build", - "serverTarget": "test-app:server" - }, - "configurations": { - "production": { - "browserTarget": "test-app:build:production", - "serverTarget": "test-app:server:production" - } - } - }, - "prerender": { - "builder": "@nguniversal/builders:prerender", - "options": { - "browserTarget": "test-app:build:production", - "serverTarget": "test-app:server:production", - "routes": [] - } - } - } - } - }, - "cli": { - "schematicCollections": ["@angular-eslint/schematics"], - "cache": { - "enabled": false - } - } -} diff --git a/angular/test/base/angular.json b/angular/test/base/angular.json index 09b8016328..2d5b6774e3 100644 --- a/angular/test/base/angular.json +++ b/angular/test/base/angular.json @@ -13,7 +13,6 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "aot": true, "outputPath": "dist/test-app/browser", "index": "src/index.html", "main": "src/main.ts", @@ -64,8 +63,17 @@ "maximumWarning": "6kb" } ] + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true } - } + }, + "defaultConfiguration": "production" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", @@ -75,8 +83,12 @@ "configurations": { "production": { "browserTarget": "test-app:build:production" + }, + "development": { + "browserTarget": "test-app:build:development" } - } + }, + "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", @@ -136,9 +148,7 @@ } }, "cli": { - "schematicCollections": [ - "@angular-eslint/schematics" - ], + "schematicCollections": ["@angular-eslint/schematics"], "cache": { "enabled": false }