35 lines
852 B
TypeScript
35 lines
852 B
TypeScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
const _dirname =
|
|
typeof __dirname !== "undefined"
|
|
? __dirname
|
|
: path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
svelte({
|
|
hot: !process.env.VITEST,
|
|
}),
|
|
],
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
setupFiles: ["./config/vitest/setup.ts"],
|
|
include: ["src/**/*.test.{js,ts}"],
|
|
exclude: ["src/**/*.e2e.{js,ts}"],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
$lib: path.resolve("./src/shared/lib"),
|
|
$shared: path.resolve("./src/shared"),
|
|
$pages: path.resolve("./src/pages"),
|
|
$features: path.resolve("./src/features"),
|
|
$entities: path.resolve("./src/entities"),
|
|
$widgets: path.resolve("./src/widgets"),
|
|
},
|
|
},
|
|
});
|