2022-11-23 01:28:33 +00:00
|
|
|
import * as path from 'path'
|
|
|
|
import { defineConfig } from 'vite'
|
2023-02-03 23:01:29 +00:00
|
|
|
import sveltePreprocess from 'svelte-preprocess'
|
2022-11-23 01:28:33 +00:00
|
|
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
2022-11-24 03:54:22 +00:00
|
|
|
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
2022-11-23 01:28:33 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2022-12-06 05:46:40 +00:00
|
|
|
build: {
|
|
|
|
sourcemap: true,
|
|
|
|
},
|
2022-11-23 01:28:33 +00:00
|
|
|
resolve: {
|
2022-11-24 03:54:22 +00:00
|
|
|
alias: {
|
|
|
|
src: path.resolve(__dirname, 'src'),
|
|
|
|
}
|
2022-11-23 01:28:33 +00:00
|
|
|
},
|
2022-11-24 03:54:22 +00:00
|
|
|
plugins: [
|
|
|
|
nodePolyfills({
|
|
|
|
protocolImports: true,
|
|
|
|
}),
|
|
|
|
svelte({
|
2023-02-03 23:01:29 +00:00
|
|
|
preprocess: sveltePreprocess(),
|
2022-11-24 03:54:22 +00:00
|
|
|
onwarn: (warning, handler) => {
|
2023-02-03 23:01:29 +00:00
|
|
|
const isA11y = warning.code.startsWith('a11y-')
|
|
|
|
|
|
|
|
if (["a11y-autofocus"].includes(warning.code)) return
|
|
|
|
if (warning.filename.includes("node_modules")) return
|
|
|
|
if (warning.filename.includes("Card.svelte") && isA11y) return
|
|
|
|
|
2022-11-24 03:54:22 +00:00
|
|
|
handler(warning)
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2022-11-23 01:28:33 +00:00
|
|
|
})
|