-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
33 lines (32 loc) · 1005 Bytes
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defineConfig } from "vite";
import devServer from "@hono/vite-dev-server";
import emitCssModules from "./emitCssModules";
export default defineConfig(({ command }) => {
return {
build: {
cssMinify: true,
minify: true,
rollupOptions: {
output: {
entryFileNames: "_worker.js",
},
external: ["node:zlib", "bun:sqlite"],
},
// We're not actually using SSR, but using the ssr option compiles
// the server and enables the ssrEmitAssets option.
ssr: "./src/index.tsx",
// Emit global CSS and client JS pulled in by '...?url' imports.
ssrEmitAssets: true,
// Generate a manifest.json file that can be used to map compiled CSS modules to components.
manifest: true,
target: "es2022",
},
plugins: [
// Experimental plugin to emit CSS modules as chunks.
command === "build" && emitCssModules(),
devServer({
entry: "./src/index.tsx",
}),
],
};
});