From 6c7165520de874c0b71438c3ae23f32480239b07 Mon Sep 17 00:00:00 2001 From: nicholas-codecov Date: Mon, 23 Dec 2024 09:56:35 -0400 Subject: [PATCH] use defineConfig as it reduces the issues with types --- packages/astro-plugin/vitest.config.ts | 4 ++-- packages/bundle-analyzer/vitest.config.ts | 10 +++------- packages/bundler-plugin-core/vitest.config.ts | 4 ++-- packages/nextjs-webpack-plugin/vitest.config.ts | 4 ++-- packages/nuxt-plugin/vitest.config.ts | 4 ++-- packages/remix-vite-plugin/vitest.config.ts | 4 ++-- packages/rollup-plugin/vitest.config.ts | 4 ++-- packages/solidstart-plugin/vitest.config.ts | 4 ++-- packages/sveltekit-plugin/vitest.config.ts | 4 ++-- packages/vite-plugin/vitest.config.ts | 4 ++-- packages/webpack-plugin/vitest.config.ts | 4 ++-- 11 files changed, 23 insertions(+), 27 deletions(-) diff --git a/packages/astro-plugin/vitest.config.ts b/packages/astro-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/astro-plugin/vitest.config.ts +++ b/packages/astro-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/bundle-analyzer/vitest.config.ts b/packages/bundle-analyzer/vitest.config.ts index 84c0c96e..26242e52 100644 --- a/packages/bundle-analyzer/vitest.config.ts +++ b/packages/bundle-analyzer/vitest.config.ts @@ -1,5 +1,5 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; import "ts-node/register"; @@ -10,16 +10,12 @@ const packageJson = await import("./package.json", { assert: { type: "json" }, }); -const setupTsNode = { +export default defineConfig({ + ...config, files: ["./setup.ts"], transformMode: { web: [/\.tsx?$/], }, -}; - -export default defineProject({ - ...config, - ...setupTsNode, plugins: [ // @ts-expect-error - using rollup plugin { diff --git a/packages/bundler-plugin-core/vitest.config.ts b/packages/bundler-plugin-core/vitest.config.ts index 68560a1f..4669c6d2 100644 --- a/packages/bundler-plugin-core/vitest.config.ts +++ b/packages/bundler-plugin-core/vitest.config.ts @@ -1,6 +1,6 @@ -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; -export default defineProject({ +export default defineConfig({ ...config, }); diff --git a/packages/nextjs-webpack-plugin/vitest.config.ts b/packages/nextjs-webpack-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/nextjs-webpack-plugin/vitest.config.ts +++ b/packages/nextjs-webpack-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/nuxt-plugin/vitest.config.ts b/packages/nuxt-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/nuxt-plugin/vitest.config.ts +++ b/packages/nuxt-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/remix-vite-plugin/vitest.config.ts b/packages/remix-vite-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/remix-vite-plugin/vitest.config.ts +++ b/packages/remix-vite-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/rollup-plugin/vitest.config.ts b/packages/rollup-plugin/vitest.config.ts index c1e62071..31d79bd2 100644 --- a/packages/rollup-plugin/vitest.config.ts +++ b/packages/rollup-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ { diff --git a/packages/solidstart-plugin/vitest.config.ts b/packages/solidstart-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/solidstart-plugin/vitest.config.ts +++ b/packages/solidstart-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/sveltekit-plugin/vitest.config.ts b/packages/sveltekit-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/sveltekit-plugin/vitest.config.ts +++ b/packages/sveltekit-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/vite-plugin/vitest.config.ts b/packages/vite-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/vite-plugin/vitest.config.ts +++ b/packages/vite-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types diff --git a/packages/webpack-plugin/vitest.config.ts b/packages/webpack-plugin/vitest.config.ts index 5ec1a42c..5167f2b7 100644 --- a/packages/webpack-plugin/vitest.config.ts +++ b/packages/webpack-plugin/vitest.config.ts @@ -1,10 +1,10 @@ import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; import { config } from "../../vitest.shared"; const packageJson = await import("./package.json"); -export default defineProject({ +export default defineConfig({ ...config, plugins: [ //@ts-expect-error handle conflicting version types