]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: work around vitest `mergeConfig`/`defineConfig` type issues
authorHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 24 Jul 2023 17:33:12 +0000 (01:33 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 24 Jul 2023 17:33:12 +0000 (01:33 +0800)
Until https://github.com/vitest-dev/vitest/pull/3804 is merged and
released, we can work around the issue by using the exports from `vite`,
they are identical anyway.

In later versions, we should import both `mergeConfig` and
`defineConfig` from `vitest`, though, to better align with their
official documentation.

Fixes #313
Fixes #317

template/config/vitest/vitest.config.js

index 36c6643461694e5a12608ff554ba5f5c237fc52a..42638b258e86b5884053a10c5829f030a1f38836 100644 (file)
@@ -1,6 +1,6 @@
 import { fileURLToPath } from 'node:url'
-import { mergeConfig } from 'vite'
-import { configDefaults, defineConfig } from 'vitest/config'
+import { mergeConfig, defineConfig } from 'vite'
+import { configDefaults } from 'vitest/config'
 import viteConfig from './vite.config'
 
 export default mergeConfig(