coracle/vite.config.js

34 lines
837 B
JavaScript
Raw Normal View History

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'
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: {
alias: {
src: path.resolve(__dirname, 'src'),
}
2022-11-23 01:28:33 +00:00
},
plugins: [
nodePolyfills({
protocolImports: true,
}),
svelte({
2023-02-03 23:01:29 +00:00
preprocess: sveltePreprocess(),
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
handler(warning)
},
}),
],
2022-11-23 01:28:33 +00:00
})