-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
39 lines (35 loc) · 969 Bytes
/
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
import process from 'node:process'
import sveltePreprocess from 'svelte-preprocess'
import postcss from './postcss.config.js'
const {NODE_ENV = 'development'} = process.env
const production = NODE_ENV === 'production'
export const ignoreWarnings = new Set([
'a11y-no-onchange',
'a11y-label-has-associated-control',
'a11y-click-events-have-key-events',
// 'vite-plugin-svelte-css-no-scopable-elements',
// 'css-unused-selector',
// 'missing-declaration',
])
export default {
compilerOptions: {
dev: !production,
},
preprocess: sveltePreprocess({
sourceMap: !production,
postcss,
}),
// vite/rollup
onwarn(warning, handler) {
// console.log('------------------>>>', 'warning.code', warning.code)
if (ignoreWarnings.has(warning.code)) {
return
}
handler(warning)
},
// esbuild
filterWarnings(warning) {
// console.log('------------------>>>', JSON.stringify(warning, undefined, ' '))
return !ignoreWarnings.has(warning.code)
},
}