-
Notifications
You must be signed in to change notification settings - Fork 1
/
svelte.config.js
50 lines (45 loc) · 1.24 KB
/
svelte.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
46
47
48
49
50
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import adapter_vercel from '@sveltejs/adapter-vercel'
import { sveltePreprocess } from 'svelte-preprocess'
import adapter_auto from '@sveltejs/adapter-auto'
import browser_extension from './adapter.js'
const vercel = !!process.env.VERCEL
const extension = !!process.env.BROWSER_EXTENSION
const adapter = vercel
? adapter_vercel()
: extension
? browser_extension({ fallback: 'index.html' })
: adapter_auto()
const ignoreWarnings = ['a11y-click-events-have-key-events']
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [
vitePreprocess(),
sveltePreprocess({
pug: true,
scss: true,
}),
],
kit: {
adapter,
appDir: 'ext', //* This is important - chrome extensions can't handle the default _app directory name.
},
vitePlugin: {
inspector: {
toggleButtonPos: 'bottom-left',
toggleKeyCombo: 'meta-shift',
showToggleButton: 'always',
holdMode: true,
},
},
// @ts-expect-error - Why isn't this typed?
onwarn: (warning, handler) => {
// if (warning.code.startsWith('a11y-')) {
if (ignoreWarnings.includes(warning.code)) {
return
}
handler(warning)
},
warningFilter: (ree) => !ree.code.startsWith('a11y'),
}
export default config