-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (39 loc) · 899 Bytes
/
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
import type { UserConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
const config: UserConfig = {
plugins: [
svelte(),
{
name: 'html',
enforce: 'post',
transformIndexHtml: (html) =>
html
.replace(
/<script type="module" crossorigin src="([^"]+)"><\/script>/g,
'<script defer src=".$1"></script>',
)
.replace(
/<link rel="stylesheet" href="([^"]+)">/g,
'<link rel="stylesheet" href=".$1">',
),
},
],
publicDir: 'assets',
envDir: './',
envPrefix: 'PUBLIC_',
build: {
outDir: 'dist/com.brianschwabauer.streamdeck.sdPlugin',
assetsInlineLimit: 999999999,
sourcemap: true,
rollupOptions: {
output: {
inlineDynamicImports: true,
format: 'es',
entryFileNames: '[name].js',
assetFileNames: '[name].[ext]',
chunkFileNames: '[name].[ext]',
},
},
},
};
export default config;