Skip to content

Commit

Permalink
dev: fix vite config per yusukebe
Browse files Browse the repository at this point in the history
  • Loading branch information
justinnoel committed Mar 3, 2024
1 parent dd376ee commit 89b5b39
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import { defineConfig } from "vite";
import { getPlatformProxy } from "wrangler";
import honox from "honox/vite";
import clientBuild from "honox/vite/client";
import pagesBuild from "@hono/vite-cloudflare-pages";
import { defineConfig } from 'vite'
import { getPlatformProxy } from 'wrangler'
import honox from 'honox/vite'
import clientBuild from 'honox/vite/client'
import pagesBuild from '@hono/vite-cloudflare-pages'

export default defineConfig(async ({ mode }) => {
const { env, dispose } = await getPlatformProxy();
if (mode === "client") {
export default defineConfig(async ({ mode, command }) => {
if (mode === 'client') {
return {
plugins: [clientBuild()],
};
plugins: [clientBuild()]
}
}
if (command === 'build') {
return {
plugins: [honox(), pagesBuild()]
}
}
const { env, dispose } = await getPlatformProxy()
return {
plugins: [
honox({
devServer: {
env,
plugins: [
{
onServerClose: dispose,
},
],
},
onServerClose: dispose
}
]
}
}),
pagesBuild(),
],
};
});
pagesBuild()
]
}
})

0 comments on commit 89b5b39

Please sign in to comment.