diff --git a/viteroll/examples/mpa/src/index.html b/viteroll/examples/mpa/src/index.html index 530a68d..0564e5d 100644 --- a/viteroll/examples/mpa/src/index.html +++ b/viteroll/examples/mpa/src/index.html @@ -9,7 +9,7 @@

Home

  • About
  • - + diff --git a/viteroll/examples/mpa/vite.config.ts b/viteroll/examples/mpa/vite.config.ts index c5d2b0e..a906e7e 100644 --- a/viteroll/examples/mpa/vite.config.ts +++ b/viteroll/examples/mpa/vite.config.ts @@ -1,5 +1,5 @@ import { defineConfig } from "vite"; -import { viteroll } from "../../viteroll"; +// import { viteroll } from "../../viteroll"; export default defineConfig({ root: "./src", @@ -15,5 +15,8 @@ export default defineConfig({ }, }, }, - plugins: [viteroll()], + experimental: { + rolldownDev: { hmr: true, reactRefresh: true }, + }, + // plugins: [viteroll()], }); diff --git a/viteroll/examples/react/index.html b/viteroll/examples/react/index.html index 6ff4e4d..c9ffede 100644 --- a/viteroll/examples/react/index.html +++ b/viteroll/examples/react/index.html @@ -2,12 +2,11 @@ - Vite + React + TS
    - + diff --git a/viteroll/examples/react/vite.config.ts b/viteroll/examples/react/vite.config.ts index 115722a..5d7b4bc 100644 --- a/viteroll/examples/react/vite.config.ts +++ b/viteroll/examples/react/vite.config.ts @@ -1,10 +1,13 @@ import { defineConfig } from "vite"; -import { viteroll } from "../../viteroll"; +// import { viteroll } from "../../viteroll"; export default defineConfig({ + experimental: { + rolldownDev: { hmr: true, reactRefresh: true }, + }, plugins: [ - viteroll({ - reactRefresh: true, - }), + // viteroll({ + // reactRefresh: true, + // }), ], }); diff --git a/viteroll/examples/ssr/vite.config.ts b/viteroll/examples/ssr/vite.config.ts index dfd7cc5..6ba2411 100644 --- a/viteroll/examples/ssr/vite.config.ts +++ b/viteroll/examples/ssr/vite.config.ts @@ -1,5 +1,5 @@ import { defineConfig } from "vite"; -import { RolldownEnvironment, viteroll } from "../../viteroll"; +// import { RolldownEnvironment, viteroll } from "../../viteroll"; process.setSourceMapsEnabled(true); @@ -24,10 +24,13 @@ export default defineConfig({ }, }, }, + experimental: { + rolldownDev: { hmr: true, reactRefresh: true }, + }, plugins: [ - viteroll({ - reactRefresh: true, - }), + // viteroll({ + // reactRefresh: true, + // }), { name: "ssr-middleware", config() { @@ -37,10 +40,11 @@ export default defineConfig({ }, configureServer(server) { return () => { - const devEnv = server.environments.ssr as RolldownEnvironment; server.middlewares.use(async (req, res, next) => { try { - const mod = (await devEnv.import("index")) as any; + const mod = (await (server.environments.ssr as any).import( + "index", + )) as any; await mod.default(req, res); } catch (e) { next(e); diff --git a/viteroll/package.json b/viteroll/package.json index a9de930..6adadeb 100644 --- a/viteroll/package.json +++ b/viteroll/package.json @@ -22,7 +22,7 @@ "preact": "^10.24.3", "rolldown": "0.13.2-snapshot-a292401-20241105072341", "typescript": "^5.6.3", - "vite": "6.0.0-beta.8" + "vite": "./vite-6.0.0-beta.8.tgz" }, "peerDependencies": { "rolldown": "*", diff --git a/viteroll/pnpm-lock.yaml b/viteroll/pnpm-lock.yaml index 767e252..46a9cf4 100644 --- a/viteroll/pnpm-lock.yaml +++ b/viteroll/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: overrides: rolldown: 0.13.2-snapshot-a292401-20241105072341 - vite: 6.0.0-beta.8 + vite: ./vite-6.0.0-beta.8.tgz importers: @@ -41,8 +41,8 @@ importers: specifier: ^5.6.3 version: 5.6.3 vite: - specifier: 6.0.0-beta.8 - version: 6.0.0-beta.8(@types/node@22.8.5) + specifier: ./vite-6.0.0-beta.8.tgz + version: file:vite-6.0.0-beta.8.tgz(@types/node@22.8.5) examples/mpa: {} @@ -772,8 +772,9 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} - vite@6.0.0-beta.8: - resolution: {integrity: sha512-KbUpk2e8NvL1aYGJdV4FfppDq/ygwTm+YUqGyUUb30K9R2Z9Up6a1D4203D2YRQb5pT4hChmYsXPA3MZ1R3ohA==} + vite@file:vite-6.0.0-beta.8.tgz: + resolution: {integrity: sha512-B8BnnW4DL8mqftbKod44Cl09YmuXaHZeUWtogsQHZp9ke9O+t6PZR72S1kD0YHq9pBDbdId6IAVL3hTNIoFJMw==, tarball: file:vite-6.0.0-beta.8.tgz} + version: 6.0.0-beta.8 engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -1404,13 +1405,19 @@ snapshots: utils-merge@1.0.1: {} - vite@6.0.0-beta.8(@types/node@22.8.5): + vite@file:vite-6.0.0-beta.8.tgz(@types/node@22.8.5): dependencies: esbuild: 0.24.0 postcss: 8.4.47 + react-refresh: 0.14.2 + rolldown: 0.13.2-snapshot-a292401-20241105072341 rollup: 4.24.3 optionalDependencies: '@types/node': 22.8.5 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate watchpack@2.4.2: dependencies: diff --git a/viteroll/vite-6.0.0-beta.8.tgz b/viteroll/vite-6.0.0-beta.8.tgz new file mode 100644 index 0000000..1f1966d Binary files /dev/null and b/viteroll/vite-6.0.0-beta.8.tgz differ diff --git a/viteroll/vite.config.ts b/viteroll/vite.config.ts index e4af2de..6408cd2 100644 --- a/viteroll/vite.config.ts +++ b/viteroll/vite.config.ts @@ -1,6 +1,6 @@ import * as rolldown from "rolldown"; import { type Plugin, defineConfig } from "vite"; -import { viteroll } from "./viteroll"; +// import { viteroll } from "./viteroll"; export default defineConfig({ clearScreen: false, @@ -10,8 +10,11 @@ export default defineConfig({ resolve: { alias: {}, }, + experimental: { + rolldownDev: { hmr: true }, + }, plugins: [ - viteroll(), + // viteroll(), { name: "test-virtual", resolveId: {