diff --git a/package.json b/package.json index 859a3e5..02c9357 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@adonisjs/prettier-config": "^1.4.0", "@adonisjs/session": "7.5.0", "@adonisjs/tsconfig": "^1.4.0", - "@adonisjs/vite": "^3.0.0", + "@adonisjs/vite": "4.0.0-beta.0", "@japa/api-client": "^2.0.3", "@japa/assert": "3.0.0", "@japa/expect-type": "^2.0.2", @@ -57,8 +57,8 @@ "@types/node": "^22.7.4", "@types/qs": "^6.9.16", "@types/supertest": "^6.0.2", - "@vavite/multibuild": "^4.1.3", - "c8": "^10.1.2", + "@vavite/multibuild": "^5.1.0", + "c8": "^10.1.3", "copyfiles": "^2.4.1", "del-cli": "^5.1.0", "edge-parser": "^9.0.3", @@ -71,7 +71,7 @@ "ts-node-maintained": "^10.9.4", "tsup": "^8.3.0", "typescript": "~5.6.2", - "vite": "^5.4.8" + "vite": "^6.0.3" }, "dependencies": { "@poppinss/utils": "^6.8.3", @@ -85,7 +85,7 @@ "peerDependencies": { "@adonisjs/core": "^6.9.1", "@adonisjs/session": "^7.4.0", - "@adonisjs/vite": "^3.0.0", + "@adonisjs/vite": "4.0.0-beta.0", "@japa/api-client": "^2.0.0", "edge.js": "^6.0.0" }, diff --git a/src/server_renderer.ts b/src/server_renderer.ts index b95ab80..e7ac3af 100644 --- a/src/server_renderer.ts +++ b/src/server_renderer.ts @@ -11,7 +11,7 @@ import { Vite } from '@adonisjs/vite' import { pathToFileURL } from 'node:url' import type { PageObject, RenderInertiaSsrApp, ResolvedConfig } from './types.js' -import type { ViteRuntime } from 'vite/runtime' +import type { ModuleRunner } from 'vite/module-runner' /** * Responsible for rendering page on the server @@ -21,7 +21,7 @@ import type { ViteRuntime } from 'vite/runtime' * bundle generated by Vite */ export class ServerRenderer { - static runtime: ViteRuntime + static runtime: ModuleRunner constructor( protected config: ResolvedConfig, @@ -43,9 +43,9 @@ export class ServerRenderer { * if we are in development mode */ if (devServer) { - ServerRenderer.runtime ??= await this.vite!.createRuntime() + ServerRenderer.runtime ??= await this.vite!.createModuleRunner() ServerRenderer.runtime.clearCache() - render = await ServerRenderer.runtime.executeEntrypoint(this.config.ssr.entrypoint!) + render = await ServerRenderer.runtime.import(this.config.ssr.entrypoint!) } else { /** * Otherwise, just import the SSR bundle