Skip to content

Commit

Permalink
chore(viteroll): test vite rolldown dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 12, 2024
1 parent e574d32 commit b90cc92
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
7 changes: 5 additions & 2 deletions viteroll/examples/mpa/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { viteroll } from "../../viteroll";
// import { viteroll } from "../../viteroll";

export default defineConfig({
root: "./src",
Expand All @@ -15,5 +15,8 @@ export default defineConfig({
},
},
},
plugins: [viteroll()],
experimental: {
rolldownDev: { hmr: true, reactRefresh: true },
},
// plugins: [viteroll()],
});
11 changes: 7 additions & 4 deletions viteroll/examples/react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -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,
// }),
],
});
16 changes: 10 additions & 6 deletions viteroll/examples/ssr/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import { RolldownEnvironment, viteroll } from "../../viteroll";
// import { RolldownEnvironment, viteroll } from "../../viteroll";

process.setSourceMapsEnabled(true);

Expand All @@ -24,10 +24,13 @@ export default defineConfig({
},
},
},
experimental: {
rolldownDev: { hmr: true, reactRefresh: true },
},
plugins: [
viteroll({
reactRefresh: true,
}),
// viteroll({
// reactRefresh: true,
// }),
{
name: "ssr-middleware",
config() {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion viteroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
19 changes: 13 additions & 6 deletions viteroll/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added viteroll/vite-6.0.0-beta.8.tgz
Binary file not shown.
7 changes: 5 additions & 2 deletions viteroll/vite.config.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -10,8 +10,11 @@ export default defineConfig({
resolve: {
alias: {},
},
experimental: {
rolldownDev: { hmr: true },
},
plugins: [
viteroll(),
// viteroll(),
{
name: "test-virtual",
resolveId: {
Expand Down

0 comments on commit b90cc92

Please sign in to comment.