This is an automated email from the ASF dual-hosted git repository.

leezng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a79e60d3 [INLONG-6775][Dashboard] Fix the risk of source code 
exposure in the production environment (#6776)
2a79e60d3 is described below

commit 2a79e60d31840aae6de8003ba6e9257d14b75903
Author: Daniel <lee...@apache.org>
AuthorDate: Wed Dec 7 15:51:37 2022 +0800

    [INLONG-6775][Dashboard] Fix the risk of source code exposure in the 
production environment (#6776)
---
 inlong-dashboard/.env.production   |  1 +
 inlong-dashboard/craco.config.ts   |  4 +-
 inlong-dashboard/package-lock.json | 80 +++++++++++++++++++++++++++++++-------
 inlong-dashboard/package.json      |  4 +-
 4 files changed, 70 insertions(+), 19 deletions(-)

diff --git a/inlong-dashboard/.env.production b/inlong-dashboard/.env.production
new file mode 100644
index 000000000..4f79a0f8e
--- /dev/null
+++ b/inlong-dashboard/.env.production
@@ -0,0 +1 @@
+GENERATE_SOURCEMAP=false
\ No newline at end of file
diff --git a/inlong-dashboard/craco.config.ts b/inlong-dashboard/craco.config.ts
index b60e17ead..360ac5b9f 100644
--- a/inlong-dashboard/craco.config.ts
+++ b/inlong-dashboard/craco.config.ts
@@ -18,7 +18,7 @@
  */
 
 import CracoLess from 'craco-less';
-import CracoAlias from 'craco-alias';
+import { CracoAliasPlugin } from 'react-app-alias';
 import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin';
 import type { CracoConfig } from 'craco__craco';
 
@@ -38,7 +38,7 @@ const config: CracoConfig = {
       },
     },
     {
-      plugin: CracoAlias,
+      plugin: CracoAliasPlugin,
       options: {
         source: 'tsconfig',
         baseUrl: './',
diff --git a/inlong-dashboard/package-lock.json 
b/inlong-dashboard/package-lock.json
index 05b0d983b..6cbafa050 100644
--- a/inlong-dashboard/package-lock.json
+++ b/inlong-dashboard/package-lock.json
@@ -1529,18 +1529,68 @@
       "dev": true
     },
     "@craco/craco": {
-      "version": "7.0.0-alpha.7",
-      "resolved": 
"https://registry.npmjs.org/@craco/craco/-/craco-7.0.0-alpha.7.tgz";,
-      "integrity": 
"sha512-3RU+Ur1GvBQKDBL1JhssSgazc8s3pMAgndyS+95UaXdMTuozpI9h4k4OokQRRjiLmr7i0y39l6fBZvknGj2i1w==",
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/@craco/craco/-/craco-7.0.0.tgz";,
+      "integrity": 
"sha512-OyjL9zpURB6Ha1HO62Hlt27Xd7UYJ8DRiBNuE4DBB8Ue0iQ9q/xsv3ze7ROm6gCZqV6I2Gxjnq0EHCCye+4xDQ==",
       "dev": true,
       "requires": {
-        "autoprefixer": "^10.4.7",
+        "autoprefixer": "^10.4.12",
         "cosmiconfig": "^7.0.1",
-        "cosmiconfig-typescript-loader": "^2.0.2",
+        "cosmiconfig-typescript-loader": "^1.0.0",
         "cross-spawn": "^7.0.3",
         "lodash": "^4.17.21",
         "semver": "^7.3.7",
         "webpack-merge": "^5.8.0"
+      },
+      "dependencies": {
+        "autoprefixer": {
+          "version": "10.4.13",
+          "resolved": 
"https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz";,
+          "integrity": 
"sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==",
+          "dev": true,
+          "requires": {
+            "browserslist": "^4.21.4",
+            "caniuse-lite": "^1.0.30001426",
+            "fraction.js": "^4.2.0",
+            "normalize-range": "^0.1.2",
+            "picocolors": "^1.0.0",
+            "postcss-value-parser": "^4.2.0"
+          }
+        },
+        "browserslist": {
+          "version": "4.21.4",
+          "resolved": 
"https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz";,
+          "integrity": 
"sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==",
+          "dev": true,
+          "requires": {
+            "caniuse-lite": "^1.0.30001400",
+            "electron-to-chromium": "^1.4.251",
+            "node-releases": "^2.0.6",
+            "update-browserslist-db": "^1.0.9"
+          }
+        },
+        "caniuse-lite": {
+          "version": "1.0.30001436",
+          "resolved": 
"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz";,
+          "integrity": 
"sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==",
+          "dev": true
+        },
+        "electron-to-chromium": {
+          "version": "1.4.284",
+          "resolved": 
"https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz";,
+          "integrity": 
"sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==",
+          "dev": true
+        },
+        "update-browserslist-db": {
+          "version": "1.0.10",
+          "resolved": 
"https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz";,
+          "integrity": 
"sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==",
+          "dev": true,
+          "requires": {
+            "escalade": "^3.1.1",
+            "picocolors": "^1.0.0"
+          }
+        }
       }
     },
     "@cspotcode/source-map-support": {
@@ -5262,21 +5312,15 @@
       }
     },
     "cosmiconfig-typescript-loader": {
-      "version": "2.0.2",
-      "resolved": 
"https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-2.0.2.tgz";,
-      "integrity": 
"sha512-KmE+bMjWMXJbkWCeY4FJX/npHuZPNr9XF9q9CIQ/bpFwi1qHfCmSiKarrCcRa0LO4fWjk93pVoeRtJAkTGcYNw==",
+      "version": "1.0.9",
+      "resolved": 
"https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-1.0.9.tgz";,
+      "integrity": 
"sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g==",
       "dev": true,
       "requires": {
         "cosmiconfig": "^7",
-        "ts-node": "^10.8.1"
+        "ts-node": "^10.7.0"
       }
     },
-    "craco-alias": {
-      "version": "3.0.1",
-      "resolved": 
"https://registry.npmjs.org/craco-alias/-/craco-alias-3.0.1.tgz";,
-      "integrity": 
"sha512-N+Qaf/Gr/f3o5ZH2TQjMu5NhR9PnT1ZYsfejpNvZPpB0ujdrhsSr4Ct6GVjnV5ostCVquhTKJpIVBKyL9qDQYA==",
-      "dev": true
-    },
     "craco-less": {
       "version": "2.1.0-alpha.0",
       "resolved": 
"https://registry.npmjs.org/craco-less/-/craco-less-2.1.0-alpha.0.tgz";,
@@ -12870,6 +12914,12 @@
         "object-assign": "^4.1.1"
       }
     },
+    "react-app-alias": {
+      "version": "2.2.2",
+      "resolved": 
"https://registry.npmjs.org/react-app-alias/-/react-app-alias-2.2.2.tgz";,
+      "integrity": 
"sha512-mkebUkGLEBA8A8jripu5h1e3cccGl8wWHCUmyJo43/KhaN91DO3qyCLWGWneogqkG4PWhp2JHtlCJ06YSdHVYQ==",
+      "dev": true
+    },
     "react-app-polyfill": {
       "version": "3.0.0",
       "resolved": 
"https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-3.0.0.tgz";,
diff --git a/inlong-dashboard/package.json b/inlong-dashboard/package.json
index 790e2b3b3..cfcfee779 100644
--- a/inlong-dashboard/package.json
+++ b/inlong-dashboard/package.json
@@ -60,7 +60,7 @@
     }
   },
   "devDependencies": {
-    "@craco/craco": "^7.0.0-alpha.3",
+    "@craco/craco": "^7.0.0",
     "@testing-library/jest-dom": "^5.16.4",
     "@testing-library/react": "^13.1.1",
     "@testing-library/user-event": "^14.1.1",
@@ -75,7 +75,6 @@
     "@vitejs/plugin-react": "^2.0.1",
     "antd-dayjs-webpack-plugin": "^1.0.6",
     "babel-plugin-import": "^1.13.5",
-    "craco-alias": "^3.0.1",
     "craco-less": "^2.1.0-alpha.0",
     "eslint": "^8.22.0",
     "eslint-config-prettier": "^8.5.0",
@@ -86,6 +85,7 @@
     "postcss": "^8.4.16",
     "postcss-less": "^6.0.0",
     "prettier": "^2.6.2",
+    "react-app-alias": "^2.2.2",
     "react-scripts": "^5.0.1",
     "source-map-explorer": "^2.5.2",
     "stylelint": "^14.7.1",

Reply via email to