From c3b2e29faf126e63c96b047b13efbea2bbc9d5f4 Mon Sep 17 00:00:00 2001 From: huanhuanwa <44698191+huanhuanwa@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:58:50 +0800 Subject: [PATCH] build: add demo build (#11) --- angular.json | 29 +++++++++++++++++------------ package.json | 3 ++- tsconfig.app.json | 11 +++++++---- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/angular.json b/angular.json index 08474fef..06d8e963 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,10 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { - "outputPath": "dist/ai-table", + "outputPath": { + "base": "dist/demo", + "browser": "" + }, "index": "src/index.html", "browser": "src/main.ts", "polyfills": ["zone.js"], @@ -39,19 +42,23 @@ }, "configurations": { "production": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, "budgets": [ { "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" + "maximumWarning": "2mb", + "maximumError": "5mb" }, { "type": "anyComponentStyle", "maximumWarning": "2kB", "maximumError": "4kB" } - ], - "outputHashing": "all" + ] }, "development": { "optimization": false, @@ -62,6 +69,9 @@ "defaultConfiguration": "production" }, "serve": { + "options": { + "port": 6100 + }, "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { @@ -102,18 +112,13 @@ "tsConfig": "packages/grid/tsconfig.spec.json", "karmaConfig": "packages/grid/karma.conf.js", "codeCoverage": true, - "codeCoverageExclude": [ - "packages/grid/testing/**/*" - ] + "codeCoverageExclude": ["packages/grid/testing/**/*"] } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": [ - "packages/store/**/*.ts", - "packages/store/**/*.html" - ] + "lintFilePatterns": ["packages/store/**/*.ts", "packages/store/**/*.html"] } } } diff --git a/package.json b/package.json index dafd1252..c9355d1f 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ ], "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve demo", "build": "npm run build:grid", + "build:demo": "ng build demo --configuration production", "build:grid": "ng build grid && cpx \"./packages/grid/src/**/*.scss\" ./dist/grid/", "release": "npm run build && wpm release --release-branch-format release-auto-v{{version}}", "release-next": "npm run build && wpm release --release-branch-format release-auto-next-v{{version}}", diff --git a/tsconfig.app.json b/tsconfig.app.json index 327d33b3..b05f7730 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -6,10 +6,13 @@ "outDir": "./out-tsc/app", "types": [], "paths": { - "@ai-table/grid": ["./packages/grid/src/index"] - } + "@ai-table/grid": ["./packages/grid/src/index"] + }, + "moduleResolution": "node", + "importHelpers": true, + "module": "es2020", + "lib": ["es2018", "dom"] }, "files": ["src/main.ts"], - "include": ["src/**/*.d.ts"], - + "include": ["src/**/*.d.ts"] }