diff --git a/angular.json b/angular.json index 57b4a0286..e27f8ad44 100644 --- a/angular.json +++ b/angular.json @@ -1,5 +1,8 @@ { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "cli": { + "defaultCollection": "@angular-eslint/schematics" + }, "version": 1, "newProjectRoot": "projects", "projects": { @@ -7,17 +10,22 @@ "root": "", "sourceRoot": "src", "projectType": "application", + "schematics": { + "@schematics/angular:application": { + "strict": true + } + }, "architect": { "build": { "builder": "@angular-builders/custom-webpack:browser", "options": { "outputPath": "dist", - "deleteOutputPath": false, "index": "src/index.html", "main": "src/main.ts", "tsConfig": "src/tsconfig.app.json", "polyfills": "src/polyfills.ts", "assets": [ + "src/favicon.ico", "src/assets" ], "styles": [ @@ -25,13 +33,14 @@ ], "scripts": [], "customWebpackConfig": { - "path": "./angular.webpack.js" + "path": "./angular.webpack.js", + "replaceDuplicatePlugins": true } }, "configurations": { "dev": { "optimization": false, - "outputHashing": "all", + "outputHashing": "none", "sourceMap": true, "namedChunks": false, "aot": false, @@ -45,6 +54,22 @@ } ] }, + "web": { + "optimization": false, + "outputHashing": "none", + "sourceMap": true, + "namedChunks": false, + "aot": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": false, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.web.ts" + } + ] + }, "production": { "optimization": true, "outputHashing": "all", @@ -86,16 +111,32 @@ "browserTarget": "angular-electron:build" } }, + "test": { + "builder": "@angular-builders/custom-webpack:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills-test.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "scripts": [], + "styles": [ + "src/styles.scss" + ], + "assets": [ + "src/assets" + ], + "customWebpackConfig": { + "path": "./angular.webpack.js", + "replaceDuplicatePlugins": true + } + } + }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "eslintConfig": ".eslintrc.json", - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" + "lintFilePatterns": [ + "src/**/*.ts", + "src/**/*.html" ] } } @@ -108,12 +149,8 @@ "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "eslintConfig": ".eslintrc.json", - "tsConfig": [ - "e2e/tsconfig.e2e.json" - ], - "exclude": [ - "**/node_modules/**" + "lintFilePatterns": [ + "e2e/**/*.ts" ] } } @@ -130,4 +167,4 @@ "prefix": "app" } } -} \ No newline at end of file +} diff --git a/src/environments/environment.web.ts b/src/environments/environment.web.ts new file mode 100644 index 000000000..ebacca363 --- /dev/null +++ b/src/environments/environment.web.ts @@ -0,0 +1,4 @@ +export const AppConfig = { + production: false, + environment: 'WEB', +}; diff --git a/src/index.html b/src/index.html index 688a48a20..8a2ba3bde 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,11 @@ +