3 コミット 9cee4991f7 ... f45880ed35

作者 SHA1 メッセージ 日付
  jmacura f45880ed35 🔧 don't try to build ES5 2 年 前
  jmacura 5219b6fcc0 🚨 fix dev-server config 2 年 前
  jmacura 1c810d7894 🔧 fix angular.json project names 2 年 前
5 ファイル変更97 行追加19 行削除
  1. 86 13
      angular.json
  2. 8 0
      base-webpack.config.js
  3. 2 4
      custom-webpack.config.js
  4. 0 1
      tsconfig.app.json
  5. 1 1
      tsconfig.json

+ 86 - 13
angular.json

@@ -86,18 +86,95 @@
             }
           }
         },
+        "build-no-federation": {
+          "builder": "@angular-builders/custom-webpack:browser",
+          "options": {
+            "sourceMap": true,
+            "vendorChunk": true,
+            "optimization": false,
+            "outputPath": "build",
+            "index": "src/index.html",
+            "main": "src/main.ts",
+            "polyfills": "src/polyfills.ts",
+            "tsConfig": "tsconfig.app.json",
+            "preserveSymlinks": true,
+            "allowedCommonJsDependencies": [
+              "xml-utils/find-tags-by-name",
+              "lru-cache",
+              "pbf",
+              "queue",
+              "xml-js",
+              "geostyler-legend",
+              "ol-popup",
+              "geostyler-openlayers-parser",
+              "geostyler-sld-parser"
+            ],
+            "assets": [
+              {
+                "glob": "**/*",
+                "input": "src/assets",
+                "output": "./assets"
+              },
+              {
+                "glob": "**/*",
+                "input": "./node_modules/hslayers-ng/src/assets",
+                "output": "./assets"
+              }
+            ],
+            "styles": [
+              "./node_modules/hslayers-ng/css/hslayers-ng.css",
+              "./src/styles.scss"
+            ],
+            "scripts": [],
+            "customWebpackConfig": {
+              "path": "base-webpack.config.js"
+            }
+          },
+          "configurations": {
+            "production": {
+              "fileReplacements": [
+                {
+                  "replace": "src/environments/environment.ts",
+                  "with": "src/environments/environment.prod.ts"
+                }
+              ],
+              "optimization": true,
+              "outputHashing": "all",
+              "sourceMap": true,
+              "namedChunks": false,
+              "extractLicenses": true,
+              "vendorChunk": true,
+              "buildOptimizer": true,
+              "budgets": [
+                {
+                  "type": "initial",
+                  "maximumWarning": "2mb",
+                  "maximumError": "5mb"
+                },
+                {
+                  "type": "anyComponentStyle",
+                  "maximumWarning": "200kb",
+                  "maximumError": "300kb"
+                }
+              ],
+              "customWebpackConfig": {
+                "path": "base-webpack.config.js"
+              }
+            }
+          }
+        },
         "serve": {
-          "builder": "@angular-devkit/build-angular:dev-server",
+          "builder": "@angular-builders/custom-webpack:dev-server",
           "options": {
-            "browserTarget": "hslayers-app:build"
+            "browserTarget": "fieldcalc:build-no-federation"
           },
           "configurations": {
             "production": {
-              "browserTarget": "hslayers-app:build:production"
+              "browserTarget": "fieldcalc:build-no-federation:production"
             }
           }
         },
-        "federated-serve": {
+        "federatedServe": {
           "builder": "ngx-build-plus:dev-server",
           "options": {
             "port": 5100,
@@ -105,18 +182,14 @@
           },
           "configurations": {
             "production": {
-              "browserTarget": "app:build:production"
-            },
-            "development": {
-              "browserTarget": "app:build:development"
+              "browserTarget": "fieldcalc:build:production"
             }
-          },
-          "defaultConfiguration": "development"
+          }
         },
         "extract-i18n": {
           "builder": "@angular-devkit/build-angular:extract-i18n",
           "options": {
-            "browserTarget": "hslayers-app:build"
+            "browserTarget": "fieldcalc:build"
           }
         },
         "test": {
@@ -138,11 +211,11 @@
           "builder": "@angular-devkit/build-angular:protractor",
           "options": {
             "protractorConfig": "e2e/protractor.conf.js",
-            "devServerTarget": "hslayers-app:serve"
+            "devServerTarget": "fieldcalc:serve"
           },
           "configurations": {
             "production": {
-              "devServerTarget": "hslayers-app:serve:production"
+              "devServerTarget": "fieldcalc:serve:production"
             }
           }
         }

+ 8 - 0
base-webpack.config.js

@@ -0,0 +1,8 @@
+module.exports = {
+  resolve: {
+    fallback: {
+      "path": false,
+      "fs": false,
+    },
+  },
+};

+ 2 - 4
custom-webpack.config.js

@@ -1,5 +1,6 @@
 //const webpack = require('webpack');
 const { shareAll, withModuleFederationPlugin } = require('@angular-architects/module-federation/webpack');
+const baseConfig = require('./base-webpack.config');
 
 const withModuleFederationConfig = withModuleFederationPlugin({
   name: 'fieldcalc',
@@ -52,10 +53,7 @@ const withModuleFederationConfig = withModuleFederationPlugin({
     },
   },
 });
-withModuleFederationConfig.resolve.fallback = {
-  "path": false,
-  "fs": false
-};
+withModuleFederationConfig.resolve.fallback = baseConfig.resolve.fallback;
 module.exports = withModuleFederationConfig;
 
 /*module.exports = {

+ 0 - 1
tsconfig.app.json

@@ -3,7 +3,6 @@
   "compilerOptions": {
     "outDir": "./out-tsc/app",
     "skipLibCheck": true,
-    "target": "ES5",
     "types": ["node"],
   },
   "files": [

+ 1 - 1
tsconfig.json

@@ -21,7 +21,7 @@
       "ol/*": ["node_modules/ol/*"],
       "hslayers-ng/*": ["node_modules/hslayers/*"],
       "@ngx-translate/*": ["node_modules/@ngx-translate/*"],
-      "cesium/*": ["node_modules/cesium/*"],
+      "cesium/*": ["node_modules/cesium/*"]
     }
   },
   "angularCompilerOptions": {