From 3a27e14b85d752f4ccbf7519f0d0afd5d327cc2d Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Jul 2024 00:36:37 +0800 Subject: [PATCH] feat!: make `viteOptimizeDeps` default to true --- README.md | 2 +- src/core/unplugin.ts | 2 +- src/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce53e9ec..ceed1b06 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ AutoImport({ // Include auto-imported packages in Vite's `optimizeDeps` options // Recommend to enable - viteOptimizeDeps: false, + viteOptimizeDeps: true, // Inject the imports at the end of other imports injectAtEnd: true, diff --git a/src/core/unplugin.ts b/src/core/unplugin.ts index 08976ec7..d3f37d0a 100644 --- a/src/core/unplugin.ts +++ b/src/core/unplugin.ts @@ -23,7 +23,7 @@ export default createUnplugin((options) => { }, vite: { async config(config) { - if (!options.viteOptimizeDeps) + if (options.viteOptimizeDeps === false) return const exclude = config.optimizeDeps?.exclude || [] diff --git a/src/types.ts b/src/types.ts index 253872ae..9858683f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -190,7 +190,7 @@ export interface Options { /** * Include auto-imported packages in Vite's `optimizeDeps` option * - * @default false + * @default true */ viteOptimizeDeps?: boolean }