vite.config.js 828 B

12345678910111213141516171819202122232425
  1. import postcss from './postcss.config.js';
  2. import { defineConfig } from 'vite';
  3. import { svelte } from '@sveltejs/vite-plugin-svelte';
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [
  7. svelte({
  8. onwarn(warning, defaultHandler) {
  9. const ignoredWarnings = [
  10. 'a11y-distracting-elements',
  11. 'a11y-no-static-element-interactions',
  12. 'a11y-click-events-have-key-events',
  13. ];
  14. const { code } = warning;
  15. // don't warn on <marquee> elements, cos they're cool
  16. if (ignoredWarnings.includes(code)) return;
  17. // handle all other warnings normally
  18. defaultHandler(warning);
  19. },
  20. }),
  21. ],
  22. css: { postcss },
  23. });