diff --git a/examples/express-react-vercel/package.json b/examples/express-react-vercel/package.json index 518ef88..98305c0 100644 --- a/examples/express-react-vercel/package.json +++ b/examples/express-react-vercel/package.json @@ -10,7 +10,7 @@ "express": "^4.19.2", "react": "^18.3.1", "react-dom": "^18.3.1", - "vike": "^0.4.184", + "vike": "^0.4.193", "vike-node": "^0.1.16", "vike-react": "^0.4.18", "vite": "^5.4.0" diff --git a/examples/express-react/package.json b/examples/express-react/package.json index 518ef88..98305c0 100644 --- a/examples/express-react/package.json +++ b/examples/express-react/package.json @@ -10,7 +10,7 @@ "express": "^4.19.2", "react": "^18.3.1", "react-dom": "^18.3.1", - "vike": "^0.4.184", + "vike": "^0.4.193", "vike-node": "^0.1.16", "vike-react": "^0.4.18", "vite": "^5.4.0" diff --git a/examples/hono-react-cf-pages/package.json b/examples/hono-react-cf-pages/package.json index d21797a..22ecc46 100644 --- a/examples/hono-react-cf-pages/package.json +++ b/examples/hono-react-cf-pages/package.json @@ -12,7 +12,7 @@ "hono": "^4.5.5", "react": "^18.3.1", "react-dom": "^18.3.1", - "vike": "^0.4.184", + "vike": "^0.4.193", "vike-node": "^0.1.16", "vike-react": "^0.4.18", "vite": "^5.4.0" diff --git a/examples/hono-react-vercel-edge/package.json b/examples/hono-react-vercel-edge/package.json index 0972743..6fd1529 100644 --- a/examples/hono-react-vercel-edge/package.json +++ b/examples/hono-react-vercel-edge/package.json @@ -14,7 +14,7 @@ "hono": "^4.5.5", "react": "^18.3.1", "react-dom": "^18.3.1", - "vike": "^0.4.184", + "vike": "^0.4.193", "vike-node": "^0.1.16", "vike-react": "^0.4.18", "vite": "^5.4.0", diff --git a/packages/vike-node/package.json b/packages/vike-node/package.json index 6bedea5..2efb348 100644 --- a/packages/vike-node/package.json +++ b/packages/vike-node/package.json @@ -39,7 +39,7 @@ "resolve-from": "^5.0.0" }, "peerDependencies": { - "vike": "^0.4.181", + "vike": "^0.4.193", "vite": "^5.0.10" }, "devDependencies": { @@ -50,7 +50,7 @@ "h3": "^1.12.0", "hono": "^4.5.5", "typescript": "^5.5.4", - "vike": "^0.4.184", + "vike": "^0.4.193", "vite": "^5.4.0" }, "typesVersions": { diff --git a/packages/vike-node/src/plugin/plugins/serverEntryPlugin.ts b/packages/vike-node/src/plugin/plugins/serverEntryPlugin.ts index 3244cd6..a4cc482 100644 --- a/packages/vike-node/src/plugin/plugins/serverEntryPlugin.ts +++ b/packages/vike-node/src/plugin/plugins/serverEntryPlugin.ts @@ -1,19 +1,20 @@ import pc from '@brillout/picocolors' import { createRequire } from 'module' import path from 'path' -import type { Plugin } from 'vite' +import type { Plugin, ResolvedConfig } from 'vite' import type { EntryResolved } from '../../types.js' import { assert, assertUsage } from '../../utils/assert.js' import { getConfigVikeNode } from '../utils/getConfigVikeNode.js' import { injectRollupInputs } from '../utils/injectRollupInputs.js' import { viteIsSSR } from '../utils/viteIsSSR.js' +import type { ConfigVitePluginServerEntry } from 'vike/types' const require_ = createRequire(import.meta.url) export function serverEntryPlugin(): Plugin { return { name: 'vike-node:serverEntry', - async configResolved(config) { + async configResolved(config: ResolvedConfig & ConfigVitePluginServerEntry) { const resolvedConfig = getConfigVikeNode(config) const { entry } = resolvedConfig.server const entries = Object.entries(entry) @@ -48,6 +49,9 @@ export function serverEntryPlugin(): Plugin { config ) } + + config.vitePluginServerEntry ??= {} + config.vitePluginServerEntry.inject = Object.keys(resolvedEntries) } } } diff --git a/packages/vike-node/src/plugin/plugins/standalonePlugin.ts b/packages/vike-node/src/plugin/plugins/standalonePlugin.ts index f9795bb..76cf84c 100644 --- a/packages/vike-node/src/plugin/plugins/standalonePlugin.ts +++ b/packages/vike-node/src/plugin/plugins/standalonePlugin.ts @@ -23,7 +23,7 @@ export function standalonePlugin(): Plugin { let root = '' let outDir = '' let outDirAbs = '' - let rollupEntryFilePaths: string[] + let rollupEntryFilePaths: string[] = [] let rollupResolve: any return { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fadd373..273a9ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,14 +45,14 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) vike-node: specifier: link:../../packages/vike-node version: link:../../packages/vike-node vike-react: specifier: ^0.4.18 - version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) + version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@22.2.0) @@ -75,14 +75,14 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) vike-node: specifier: link:../../packages/vike-node version: link:../../packages/vike-node vike-react: specifier: ^0.4.18 - version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) + version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@22.2.0) @@ -108,14 +108,14 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) vike-node: specifier: link:../../packages/vike-node version: link:../../packages/vike-node vike-react: specifier: ^0.4.18 - version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) + version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@22.2.0) @@ -151,14 +151,14 @@ importers: specifier: ^0.1.76 version: 0.1.76(@babel/core@7.25.2)(@babel/parser@7.25.3)(@babel/types@7.25.2)(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) vike-node: specifier: link:../../packages/vike-node version: link:../../packages/vike-node vike-react: specifier: ^0.4.18 - version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) + version: 0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@22.2.0) @@ -209,8 +209,8 @@ importers: specifier: ^5.5.4 version: 5.5.4 vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)) vite: specifier: ^5.4.0 version: 5.4.0(@types/node@20.14.15) @@ -278,8 +278,8 @@ importers: specifier: ^5.5.4 version: 5.5.4 vike: - specifier: ^0.4.184 - version: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)) + specifier: ^0.4.193 + version: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)) vike-node: specifier: link:../../packages/vike-node version: link:../../packages/vike-node @@ -462,8 +462,11 @@ packages: peerDependencies: typescript: '>=4.0.0' - '@brillout/vite-plugin-server-entry@0.4.7': - resolution: {integrity: sha512-G/wHFx/JdFUA9kPSPDT0nIJH1wmgIwUIY27RL4N6EaHeaXgN4zSCBZTNvvKHyojvMxMw825m4vE0VksHXLyOng==} + '@brillout/vite-plugin-server-entry@0.4.10': + resolution: {integrity: sha512-Ui9s3VR+Zb3MYHY40HiHazujbnLvF6p1BG3b19u50EgqwkDqmqrW/zt1fBr/+d2+HiplhyjltWjKkuB6qSpoiA==} + + '@brillout/vite-plugin-server-entry@0.4.9': + resolution: {integrity: sha512-ETiWJlljweuxXS/0TBk4eLotZ3ZFC26u7s983z2P9lmDGifZzgj7BCJzgopnDihbl8Y8usKZSLq0grrCivtMSA==} '@cloudflare/kv-asset-handler@0.3.4': resolution: {integrity: sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==} @@ -3099,8 +3102,8 @@ packages: vike: '>=0.4.178' vite: '>=4.3.8' - vike@0.4.184: - resolution: {integrity: sha512-dgoM3R4onTYm4+vTRl73+W1L1R6ryE8F9AxCCpmWdNh2KMzqMNwuMYH/9vX6AOte48l+TIGAWbcdAkZBAuU41w==} + vike@0.4.193: + resolution: {integrity: sha512-nrqSXfocmm10asmoYrczO9iO4aZZ9SNygbpDTn0emmOPUFxROW3MUd8XcuBWJh6QVUTN4KiZYZDZGBMgPfhdbg==} engines: {node: '>=18.0.0'} hasBin: true peerDependencies: @@ -3414,7 +3417,11 @@ snapshots: source-map-support: 0.5.21 typescript: 5.5.4 - '@brillout/vite-plugin-server-entry@0.4.7': + '@brillout/vite-plugin-server-entry@0.4.10': + dependencies: + '@brillout/import': 0.2.3 + + '@brillout/vite-plugin-server-entry@0.4.9': dependencies: '@brillout/import': 0.2.3 @@ -5728,7 +5735,7 @@ snapshots: '@brillout/import': 0.2.3 '@brillout/json-serializer': 0.5.13 '@brillout/picocolors': 1.0.14 - '@brillout/vite-plugin-server-entry': 0.4.7 + '@brillout/vite-plugin-server-entry': 0.4.9 es-module-lexer: 0.7.1 picocolors: 1.0.1 ts-morph: 19.0.0 @@ -5839,21 +5846,21 @@ snapshots: vary@1.1.2: {} - vike-react@0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)): + vike-react@0.4.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)))(vite@5.4.0(@types/node@22.2.0)): dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-streaming: 0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - vike: 0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) + vike: 0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)) vite: 5.4.0(@types/node@22.2.0) - vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)): + vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@20.14.15)): dependencies: '@brillout/import': 0.2.3 '@brillout/json-serializer': 0.5.13 '@brillout/picocolors': 1.0.14 '@brillout/require-shim': 0.1.2 - '@brillout/vite-plugin-server-entry': 0.4.7 + '@brillout/vite-plugin-server-entry': 0.4.10 acorn: 8.12.1 cac: 6.7.14 es-module-lexer: 1.5.4 @@ -5866,13 +5873,13 @@ snapshots: optionalDependencies: react-streaming: 0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - vike@0.4.184(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)): + vike@0.4.193(react-streaming@0.3.43(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@5.4.0(@types/node@22.2.0)): dependencies: '@brillout/import': 0.2.3 '@brillout/json-serializer': 0.5.13 '@brillout/picocolors': 1.0.14 '@brillout/require-shim': 0.1.2 - '@brillout/vite-plugin-server-entry': 0.4.7 + '@brillout/vite-plugin-server-entry': 0.4.10 acorn: 8.12.1 cac: 6.7.14 es-module-lexer: 1.5.4 diff --git a/test/vike-node/package.json b/test/vike-node/package.json index 7789a71..e52eff7 100644 --- a/test/vike-node/package.json +++ b/test/vike-node/package.json @@ -26,7 +26,7 @@ "sharp": "^0.33.4", "telefunc": "^0.1.76", "typescript": "^5.5.4", - "vike": "^0.4.184", + "vike": "^0.4.193", "vike-node": "link:../../packages/vike-node", "vite": "^5.4.0" },