Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(web): upgrade vinext and align Vite+ configuration (#43021)

Stephen Zhoufc5053edf0d2
diff --git a/.github/workflows/web-bundle-size.yml b/.github/workflows/web-bundle-size.yml
index adefb1aef73..2338988e11e 100644
--- a/.github/workflows/web-bundle-size.yml
+++ b/.github/workflows/web-bundle-size.yml
@@ -58,7 +58,7 @@ jobs:
run: |
set -o pipefail
started=$SECONDS
- pnpm exec vinext build 2>&1 | tee "$RUNNER_TEMP/vinext-build.log"
+ pnpm run build:vinext 2>&1 | tee "$RUNNER_TEMP/vinext-build.log"
printf 'Full Vinext build: **%s seconds**.\n' "$((SECONDS - started))" >> "$GITHUB_STEP_SUMMARY"
- name: Collect sizes
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 95769b02bdd..fa952bc31de 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -750,8 +750,8 @@ catalogs:
specifier: 14.0.2
version: 14.0.2
vinext:
- specifier: 1.0.0-beta.10
- version: 1.0.0-beta.10
+ specifier: 1.0.0-beta.13
+ version: 1.0.0-beta.13
vite:
specifier: npm:@voidzero-dev/[email protected]
version: 1.0.0-rc.1
@@ -1848,7 +1848,7 @@ importers:
version: 3.19.3
vinext:
specifier: 'catalog:'
vite:
specifier: 'catalog:'
@@ -4177,8 +4177,8 @@ packages:
peerDependencies:
react: '>=18.2.0'
- '@resvg/[email protected]':
- resolution: {integrity: sha512-C7c51Nn4yTxXFKvgh2txJFNweaVcfUPQxwEUFw4aWsCmfiBDJsTSwviIF8EcwjQ6k8bPyMWCl1vw4BdxE569Cg==}
+ '@resvg/[email protected]':
+ resolution: {integrity: sha512-yi6R0HyHtsoWTRA06Col4WoDs7SvlXU3DLMNP2bdAgs7HK18dTEVl1weXgxRzi8gwLteGUbIg29zulxIB3GSdg==}
engines: {node: '>= 10'}
'@rolldown/[email protected]':
@@ -5215,9 +5215,9 @@ packages:
peerDependencies:
valibot: ^1.4.0
- '@vercel/[email protected]':
- resolution: {integrity: sha512-hBcWIOppZV14bi+eAmCZj8Elj8hVSUZJTpf1lgGBhVD85pervzQ1poM/qYfFUlPraYSZYP+ASg6To5BwYmUSGQ==}
- engines: {node: '>=16'}
+ '@vercel/[email protected]':
+ resolution: {integrity: sha512-/iYJ34PDu4lty1TXdL86qHEw8viveHTllG1PWLuJX8tSFfqKL7kyVJeUORJmQ250bHB0h+alcalXUlza3c/NSA==}
+ engines: {node: '>=22'}
'@vinext/[email protected]':
resolution: {integrity: sha512-kbKY/H1RWlf7yox4G6Vwk1JeM6x0Tv1EAv28f3tDYkK3brq+89vp5eZHbdw3L/pZMbAhG4oFyhT9C976y+jkhQ==}
@@ -6060,8 +6060,8 @@ packages:
resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==}
engines: {node: '>=4'}
- resolution: {integrity: sha512-3O5QdqgFRUbXvK1x5INf1YkBz1UKSWqrd63vWsum8MNHDBYD5urm3QtxZbKU259OrEXNM26lP/MPY3d1IGkBgA==}
+ resolution: {integrity: sha512-w2Xy9UMMwlKtou0vlRnXvWglPAceXCTtcmVSo8ZBUvqCV5aXEFP/PC6d+I464810I9FT++UACwTD5511bmGPUg==}
engines: {node: '>=16'}
@@ -6826,6 +6826,9 @@ packages:
picomatch:
optional: true
+ resolution: {integrity: sha512-0Zz1jOzJWERhyhsimS54VTqOteCNwRtIlh8isdL0AXLo0g7xNTfTL7oWrkmCnPhZGocKIkWHBistBrrpoNH3aw==}
+
resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==}
@@ -6984,6 +6987,9 @@ packages:
resolution: {integrity: sha512-x/RzkpWO40bTjIoT30iQtt64FLLmH/iRcUCN2X//bLx7H3ifkdfPXyqsro/OYtqzIAhiLMMA7mmiOR9C3NOKjQ==}
engines: {node: '>=20.0.0'}
+ resolution: {integrity: sha512-SN8LVwCOzvTq3OPNd0+EAghgXugItz56wst567D1vs7LnnKGWprhi3EG58aVOBwhN8HEbQxL4I9NDWkcXUutRw==}
+
resolution: {integrity: sha512-vAyM+6+jAYwSwz0/M0jYKfU9AvAMCz0kH791RsUhvMKGUHXled/3FjcQB3YiQ4Astj5srHdb6B2FHGIfZkOQNg==}
engines: {node: '>=18'}
@@ -8701,8 +8707,8 @@ packages:
resolution: {integrity: sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==}
- resolution: {integrity: sha512-ZvHN3ygzZ8FuxjSNB+mKBiF/NIoqHzlBGbD0MJiT+MvSsFOvotnWOhdTjxKzhHRT2wPC1QbhLzx2q/Y83VhfYQ==}
+ resolution: {integrity: sha512-PNW6ktrQ8SM6kk7u4aOuTkkUewkzyTOrj+QeEzXSsnNMAdff4ire9CAqIz8+4C3rCiBtK8QTELv52AZEd1PbRw==}
engines: {node: '>=16'}
@@ -9336,8 +9342,8 @@ packages:
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
- resolution: {integrity: sha512-FsMlcoA23D69EVDYfJSRUVJ8hjRbgzOo5KBy1/ImCWtTWch+OjJlIaEzrontyEnkAo5ntnwl+wm476rOQyHhrQ==}
+ resolution: {integrity: sha512-jxicf8ssc2CKO7cVHR1VTzk8fW4yaz3Oqi36yksZsSUNAwtff3gK7Bpt7MGSTsFkBaEQ7h0Nt4dWUh2HS0pjWg==}
engines: {node: '>=22'}
hasBin: true
peerDependencies:
@@ -11732,7 +11738,7 @@ snapshots:
dependencies:
react: 19.3.0
- '@resvg/[email protected]': {}
+ '@resvg/[email protected]': {}
'@rolldown/[email protected]': {}
@@ -12695,10 +12701,14 @@ snapshots:
dependencies:
valibot: 1.4.2(@typescript/[email protected])
- '@vercel/[email protected]':
dependencies:
- '@resvg/resvg-wasm': 2.4.0
- satori: 0.16.0
+ '@resvg/resvg-wasm': 2.4.1
+ satori: 0.33.5
+ optionalDependencies:
+ sharp: 0.35.4(@types/[email protected])
+ transitivePeerDependencies:
+ - '@types/node'
'@vinext/[email protected]': {}
@@ -13513,7 +13523,7 @@ snapshots:
dependencies:
@@ -14460,6 +14470,8 @@ snapshots:
optionalDependencies:
picomatch: 4.0.7
+
@@ -14600,6 +14612,8 @@ snapshots:
- bufferutil
- utf-8-validate
+
dependencies:
ansi-regex: 6.2.2
@@ -16688,15 +16702,17 @@ snapshots:
dependencies:
'@shuding/opentype.js': 1.4.0-beta.0
css-background-parser: 0.1.0
css-box-shadow: 1.0.0-3
- css-gradient-parser: 0.0.16
+ css-gradient-parser: 0.0.17
css-to-react-native: 3.2.0
emoji-regex-xs: 2.0.1
escape-html: 1.0.3
+ fflate: 0.7.3
+ harfbuzzjs: 0.10.0
linebreak: 1.1.0
parse-css-color: 0.2.1
postcss-value-parser: 4.2.0
@@ -17345,10 +17361,10 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
dependencies:
- '@vercel/og': 0.8.6
+ '@vercel/og': 1.0.3(@types/[email protected])
'@vinext/types': 1.0.0-beta.2
ipaddr.js: 2.4.0
@@ -17362,6 +17378,7 @@ snapshots:
react-server-dom-webpack: 19.3.0([email protected]([email protected]))([email protected])
transitivePeerDependencies:
+ - '@types/node'
- next
@@ -17979,7 +17996,7 @@ time:
[email protected]: '2026-01-22T19:02:58.977Z'
[email protected]: '2024-05-06T11:23:59.259Z'
[email protected]: '2026-08-18T18:21:56.060Z'
- [email protected]: '2026-09-15T09:22:34.040Z'
+ [email protected]: '2026-09-27T01:13:25.542Z'
[email protected]: '2026-07-13T05:34:12.173Z'
[email protected]: '2026-09-26T06:29:34.142Z'
[email protected]: '2026-09-04T08:00:00.941Z'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 78b8f1ba5b6..69e4b708908 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -263,7 +263,7 @@ catalog:
unist-util-visit: 5.1.0
use-context-selector: 2.0.0
uuid: 14.0.2
- vinext: 1.0.0-beta.10
+ vinext: 1.0.0-beta.13
vite: npm:@voidzero-dev/[email protected]
vite-plugin-inspect: 12.0.2
vite-plus: 1.0.0-rc.1
diff --git a/web/README.md b/web/README.md
index 776e5a77016..7d544bacf48 100644
--- a/web/README.md
+++ b/web/README.md
@@ -45,6 +45,24 @@ Open <http://localhost:3000> with your browser to see the result.
You can start editing the files under `web/app`.
The page auto-updates as you edit the file.
+### Vinext toolchain
+
+The workspace catalog pins vinext to `1.0.0-beta.13`. Following the
+[versioned vinext guide], `dev:vinext` and `build:vinext` use the project-local
+Vite+ CLI (`vp dev` / `vp build`); the vinext plugin owns the development and multi-environment build
+lifecycle. Keep the Next.js scripts available for compatibility comparisons.
+
+When upgrading, run the installed compatibility scanner and verify the application:
+
+```bash
+pnpm -C web exec vinext check
+pnpm -C web run build:vinext
+pnpm -C web run start:vinext
+```
+
+The scanner is a starting point; also check sign-in, redirects, and the workflows
+affected by the upgrade. See the [vinext migration guide] for validation guidance.
+
## Deploy
### Deploy on server
@@ -73,6 +91,18 @@ If you want to customize the host and port:
pnpm -C web run start --port=3001 --host=0.0.0.0
```
+### Vinext standalone Node server
+
+`pnpm -C web run build:vinext` honors `output: 'standalone'` in `next.config.ts`
+and emits `web/dist/standalone`. To run the self-contained production server:
+
+```bash
+HOST=0.0.0.0 PORT=3000 node web/dist/standalone/server.js
+```
+
+Vinext uses `HOST` for the bind address; Next.js standalone uses `HOSTNAME`.
+Use `start:vinext` for local production testing. See [vinext Node deployment].
+
## Storybook
This project uses [Storybook] for UI component development.
@@ -120,4 +150,7 @@ The Dify community can be found on [Discord community], where you can ask questi
[Vite+]: https://viteplus.dev
[Vitest]: https://vitest.dev
[pnpm]: https://pnpm.io
+[versioned vinext guide]: https://github.com/cloudflare/vinext/blob/vinext%401.0.0-beta.13/README.md
+[vinext Node deployment]: https://vinext.dev/docs/deploying/other-platforms
+[vinext migration guide]: https://vinext.dev/docs/getting-started/migrating
[vinext]: https://github.com/cloudflare/vinext
diff --git a/web/docs/bundle-size.md b/web/docs/bundle-size.md
index f72cd297356..d13a24d3734 100644
--- a/web/docs/bundle-size.md
+++ b/web/docs/bundle-size.md
@@ -3,7 +3,7 @@
The main CI calls **Web Bundle Analysis** when its Web style checks are required,
for both pull requests and merge queue entries. It builds the event's exact base
commit and the tested merge commit from `github.sha` in parallel. Both run the
-complete existing `vinext build` pipeline, including the unused translations check.
+complete `build:vinext` pipeline, including the unused translations check.
No SSR, reference-analysis, or standalone stage is skipped.
This replaces the separate Vinext build in Web Style. Static checks run alongside
@@ -64,7 +64,7 @@ Use it only in a disposable checkout, as CI does:
```sh
node web/scripts/bundle-analysis.ts instrument web
-pnpm --dir web exec vinext build
+pnpm --dir web run build:vinext
node web/scripts/bundle-analysis.ts collect web "$(git rev-parse HEAD)" /tmp/current.json
node web/scripts/bundle-analysis.ts compare /tmp/base.json /tmp/current.json /tmp/report.md
```
diff --git a/web/package.json b/web/package.json
index 218a622ef72..c948011a869 100644
--- a/web/package.json
+++ b/web/package.json
@@ -12,11 +12,11 @@
"scripts": {
"analyze": "next experimental-analyze",
"build": "next build",
- "build:vinext": "vinext build",
+ "build:vinext": "vp build",
"dev": "next dev",
"dev:inspect": "next dev --inspect",
"dev:proxy": "dev-proxy --config ./dev-proxy.config.ts --env-file ./.env.local",
- "dev:vinext": "vinext dev",
+ "dev:vinext": "vp dev",
"gen-doc-paths": "node ./scripts/gen-doc-paths.ts && vp fmt types/doc-paths.ts",
"gen-icons": "pnpm --filter @dify/iconify-collections generate",
"gen-provider-initials": "node ./scripts/generate-provider-initials.ts",
diff --git a/web/vite.config.ts b/web/vite.config.ts
index 9d44d4cf644..2c4fd72b63b 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -63,16 +63,6 @@ export default defineConfig(({ command, mode, isPreview }) => {
tailwindcss(),
react(),
vinext({ react: false }),
- {
- name: 'dify-css-asset-alias',
- enforce: 'post',
- // Prepend after Vinext's tsconfig aliases, which skip CSS resolution.
- config: () => ({
- resolve: {
- alias: [{ find: '~@', replacement: projectRoot }],
- },
- }),
- },
customI18nHmrPlugin({ injectTarget: rootClientInjectTarget }),
// reactGrabOpenFilePlugin({
// injectTarget: rootClientInjectTarget,
@@ -83,6 +73,7 @@ export default defineConfig(({ command, mode, isPreview }) => {
resolve: {
tsconfigPaths: true,
alias: [
+ { find: '~@', replacement: projectRoot },
// Use the base64 build in Vite-based pipelines (vinext/vitest) to avoid wasm loader incompatibilities.
{ find: /^loro-crdt$/, replacement: 'loro-crdt/base64' },
],