-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
30 lines (29 loc) · 852 Bytes
/
vite.config.ts
File metadata and controls
30 lines (29 loc) · 852 Bytes
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
import { globSync } from "node:fs";
import { defineConfig } from "vite";
import injectHTML from "vite-plugin-html-inject";
import { viteStaticCopy } from "vite-plugin-static-copy";
export default defineConfig({
// Make paths relative so imports will work correctly
base: "",
plugins: [
injectHTML(),
viteStaticCopy({
targets: [
{
src: "wallpapers/**/credits.txt",
dest: ".",
rename: (_fileName, _extension, path) => {
return path.substring(import.meta.dirname.length + 1);
},
},
],
}),
],
build: {
rollupOptions: {
// Create a new standalone page for every wallpaper. Without this the generate CSS fucks up
// and either misses assets or mangles the CSS together.
input: globSync("./wallpapers/**/index.html"),
},
},
});