-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
30 lines (29 loc) · 867 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
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { viteSingleFile } from 'vite-plugin-singlefile'
// https://vite.dev/config/
export default defineConfig({
plugins: [
svelte(),
// Assets in Figma must be inlined
viteSingleFile({
useRecommendedBuildConfig: false,
inlinePattern: ['*ui*', '*.css']
})
],
build: {
target: 'ES2015', // Figma doesn't support ?? operator
rollupOptions: {
input: {
index: './src/main.ts', // Figma
ui: './index.html' // UI
},
output: {
dir: './dist',
entryFileNames: `[name].js`,
chunkFileNames: `[name].js`,
assetFileNames: `[name].[ext]`,
},
}
}
})