Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference types="vitest" />
- /// <reference types="vite/client" />
- import react from "@vitejs/plugin-react";
- import { setupPlugin } from "gsmk-web/vite";
- import jotaiDebugLabel from "jotai/babel/plugin-debug-label";
- import jotaiReactRefresh from "jotai/babel/plugin-react-refresh";
- import path from "path";
- import includePaths from "rollup-plugin-includepaths";
- import { defineConfig, ProxyOptions } from "vite";
- import tsconfigPaths from "vite-tsconfig-paths";
- import { configDefaults } from "vitest/config";
- const defaultProxy = "https://dev.overwatch.gsmk.de/";
- const includePathOptions = {
- include: { "~shared": "./src/shared" },
- paths: ["src", "~/*", "~shared/*", "./", "src/shared"],
- };
- const aliases = {
- "~/shared": "src/shared",
- };
- const resolvedAliases = Object.fromEntries(
- Object.entries(aliases).map(([key, value]) => [
- key,
- path.resolve(__dirname, value),
- ])
- );
- export default defineConfig({
- build: {
- rollupOptions: {
- external: ["~/shared/components/test"],
- },
- },
- plugins: [
- react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } }),
- setupPlugin(),
- tsconfigPaths(),
- includePaths(includePathOptions),
- ],
- server: {
- proxy: createProxy(),
- },
- resolve: {
- alias: {
- ...resolvedAliases,
- "~": path.resolve(__dirname, "./src"),
- },
- },
- test: {
- globals: true,
- environment: "jsdom",
- setupFiles: ["./src/setupTests.ts"],
- exclude: [...configDefaults.exclude, "./src/e2e/**"],
- },
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment