From 4680b1762c8a51283e57ae8a82433c5e4146f177 Mon Sep 17 00:00:00 2001 From: ZLY Date: Mon, 25 Aug 2025 11:26:27 +0800 Subject: [PATCH] =?UTF-8?q?build(dependencies):=20=E6=9B=B4=E6=96=B0=20@xy?= =?UTF-8?q?flow=20=E7=9B=B8=E5=85=B3=E5=8C=85=E5=B9=B6=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=20JSX=E8=BF=90=E8=A1=8C=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 next.config.js 中添加 @xyflow/react 和 @xyflow/system 的模块路径 - 更新 package.json,添加 @xyflow/system 依赖 - 在 pnpm-lock.yaml 中更新 @xyflow/system 版本 - 解决 react/jsx-runtime 找不到的问题,通过添加别名路径 --- next.config.js | 7 ++++++- package.json | 1 + pnpm-lock.yaml | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 3951004..5d009b5 100644 --- a/next.config.js +++ b/next.config.js @@ -5,6 +5,8 @@ const withLess = require('next-with-less'); const withTM = require('next-transpile-modules')([ '@arco-design/web-react', '@arco-themes/react-arco-pro', + '@xyflow/react', + '@xyflow/system' ]); const setting = require("./src/settings.json"); @@ -29,6 +31,9 @@ module.exports = withLess( './src/public/assets' ); config.resolve.alias['@'] = path.resolve(__dirname, './src'); + // 解决 react/jsx-runtime 找不到的问题 + config.resolve.alias['react/jsx-runtime'] = path.resolve(__dirname, './node_modules/react/jsx-runtime.js'); + config.resolve.alias['react/jsx-dev-runtime'] = path.resolve(__dirname, './node_modules/react/jsx-dev-runtime.js'); return config; }, @@ -43,4 +48,4 @@ module.exports = withLess( }, pageExtensions: ['tsx'], }) -); +); \ No newline at end of file diff --git a/package.json b/package.json index 6ff8336..db7ba31 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@loadable/component": "^5.13.2", "@turf/turf": "^6.5.0", "@xyflow/react": "^12.8.2", + "@xyflow/system": "^0.0.68", "axios": "^0.24.0", "bizcharts": "^4.1.15", "classnames": "^2.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4096df4..621b7b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@xyflow/react': specifier: ^12.8.2 version: 12.8.3(@types/react@17.0.2)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + '@xyflow/system': + specifier: ^0.0.68 + version: 0.0.68 axios: specifier: ^0.24.0 version: 0.24.0 @@ -1552,6 +1555,9 @@ packages: '@xyflow/system@0.0.67': resolution: {integrity: sha512-hYsmbj+8JDei0jmupBmxNLaeJEcf9kKmMl6IziGe02i0TOCsHwjIdP+qz+f4rI1/FR2CQiCZJrw4dkHOLC6tEQ==} + '@xyflow/system@0.0.68': + resolution: {integrity: sha512-QDG2wxIG4qX+uF8yzm1ULVZrcXX3MxPBoxv7O52FWsX87qIImOqifUhfa/TwsvLdzn7ic2DDBH1uI8TKbdNTYA==} + abs-svg-path@0.1.1: resolution: {integrity: sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA==} @@ -6781,6 +6787,18 @@ snapshots: d3-selection: 3.0.0 d3-zoom: 3.0.0 + '@xyflow/system@0.0.68': + dependencies: + '@types/d3-drag': 3.0.7 + '@types/d3-interpolate': 3.0.4 + '@types/d3-selection': 3.0.11 + '@types/d3-transition': 3.0.9 + '@types/d3-zoom': 3.0.8 + d3-drag: 3.0.0 + d3-interpolate: 3.0.1 + d3-selection: 3.0.0 + d3-zoom: 3.0.0 + abs-svg-path@0.1.1: {} acorn-import-phases@1.0.4(acorn@8.15.0):