-
Notifications
You must be signed in to change notification settings - Fork 9
/
vite.config.ts
44 lines (43 loc) · 1.39 KB
/
vite.config.ts
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
39
40
41
42
43
44
import {ConfigEnv, defineConfig, UserConfig} from 'vite'
import {svelte} from '@sveltejs/vite-plugin-svelte'
import {inlineSvg} from "@svelte-put/preprocess-inline-svg/vite";
// https://vitejs.dev/config/
// Vite+Jekyll setup derived from https://github.com/FabricMC/fabricmc.net/blob/b88f4f058064087405e351849a04931b27c89925/scripts/vite.config.js
export default defineConfig(() => ({
// Web build
plugins: [
inlineSvg([
{
directories: '../public/_includes/svg'
}
], {
inlineSrcAttributeName: 'inline-src',
}),
svelte()
],
publicDir: '../_site',
base: './',
build: {
sourcemap: true,
// Build directly into the Jekyll output directory
outDir: "../_site/scripts/sprinkles",
emptyOutDir: true,
copyPublicDir: false,
rollupOptions: {
preserveEntrySignatures: 'allow-extension',
input: {
'blabber-parlour': './src/sprinkles/parlour/main.ts',
'darkmode-toggle': './src/sprinkles/darkmode/main.ts',
'better-details': './src/sprinkles/details/main.ts',
'ladysnake-settings': './src/sprinkles/settings/main.ts',
'rolodex': './src/sprinkles/rolodex/main.ts',
'versions': './src/sprinkles/versions/main.ts',
},
output: {
entryFileNames: `[name].js`,
chunkFileNames: `[name].[hash].js`,
assetFileNames: `[name].[ext]`,
},
}
}
}) as UserConfig);