-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
vite.config.js
45 lines (44 loc) · 1.06 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
39
40
41
42
43
44
45
import { svelte } from '@sveltejs/vite-plugin-svelte';
import path from 'path';
import { sveltePreprocess } from 'svelte-preprocess';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
$lib: path.resolve('./src/lib/'),
},
extensions: ['.js', '.svelte'],
},
build: {
target: 'es2022',
reportCompressedSize: false,
chunkSizeWarningLimit: 5000,
sourcemap: true,
rollupOptions: {
// Output JavaScript only
input: 'src/main.js',
output: [
{
entryFileNames: 'sveltia-cms.js',
format: 'iife',
},
{
entryFileNames: 'sveltia-cms.mjs',
format: 'es',
},
],
// Keep exports in the ES module
// https://stackoverflow.com/q/71500190
preserveEntrySignatures: 'strict',
},
},
// https://esbuild.github.io/api/#legal-comments
esbuild: { legalComments: 'eof' },
plugins: [
svelte({
emitCss: false,
preprocess: sveltePreprocess(),
}),
],
});