feat: Add `optimizeDeps` config for Vite (#96)
This commit is contained in:
parent
d0f1543c2e
commit
2641393677
|
|
@ -0,0 +1,24 @@
|
|||
const include = [
|
||||
'axios',
|
||||
'store',
|
||||
'echarts',
|
||||
'lodash-es',
|
||||
'resize-detector',
|
||||
'store/plugins/expire',
|
||||
'vant/es/cell-group/style/index',
|
||||
'vant/es/popup/style/index',
|
||||
'vant/es/picker/style/index',
|
||||
'vant/es/cell/style/index',
|
||||
'vant/es/switch/style/index',
|
||||
'vant/es/space/style/index',
|
||||
'vant/es/button/style/index',
|
||||
'vant/es/empty/style/index',
|
||||
'vant/es/icon/style/index',
|
||||
'vant/es/stepper/style/index',
|
||||
]
|
||||
|
||||
const exclude = [
|
||||
'@iconify-json/carbon',
|
||||
]
|
||||
|
||||
export { include, exclude }
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "vue3-vant-mobile",
|
||||
"type": "module",
|
||||
"version": "2.3.2",
|
||||
"packageManager": "pnpm@9.0.6",
|
||||
"packageManager": "pnpm@9.1.1",
|
||||
"description": "Vue + Vite H5 Starter Template",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import type { ConfigEnv, UserConfig } from 'vite'
|
|||
import viewport from 'postcss-mobile-forever'
|
||||
import autoprefixer from 'autoprefixer'
|
||||
import { createVitePlugins } from './build/vite'
|
||||
import { exclude, include } from './build/vite/optimize'
|
||||
|
||||
export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
const root = process.cwd()
|
||||
|
|
@ -56,5 +57,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||
cssCodeSplit: false,
|
||||
chunkSizeWarningLimit: 2048,
|
||||
},
|
||||
|
||||
optimizeDeps: { include, exclude },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue