-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.js
38 lines (36 loc) · 1.03 KB
/
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
34
35
36
37
38
import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
import { defineConfig } from "vite";
import { createHtmlPlugin } from "vite-plugin-html";
import preact from "@preact/preset-vite";
import compileMarkdown from "./plugins/markdown";
import prerender from "./plugins/prerender";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
502: resolve(__dirname, "502.html"),
},
},
cssCodeSplit: true, // This is the default behavior
},
css: {
preprocessorOptions: {
scss: {
// We can't move to the recommended `sass-embedded` package because the
// build just runs infinitely during the Cloudflare build
silenceDeprecations: ["legacy-js-api"],
},
},
},
plugins: [
preact(),
compileMarkdown(),
prerender(),
createHtmlPlugin({ minify: true }),
],
});