import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vitest/config"; import vue from "@vitejs/plugin-vue"; import VueJsx from "@vitejs/plugin-vue-jsx"; export default defineConfig({ plugins: [vue(), VueJsx()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, css: { preprocessorOptions: { scss: { api: "modern-compiler", quietDeps: true, silenceDeprecations: ["import", "global-builtin", "legacy-js-api", "if-function"], }, }, }, test: { // Default to node so the many source-reading specs keep working. Specs // that mount Vue components opt into jsdom via a file-level // `// @vitest-environment jsdom` pragma, which still gets the polyfills // below because the env config keys match. environment: "node", environmentMatchGlobs: [ ["tests/unit/**/*.spec.js", "jsdom"], ], include: ["tests/unit/**/*.spec.js"], setupFiles: ["./tests/unit/setup.js"], coverage: { enabled: false, }, }, });