Skip to content

Commit

Permalink
chore: 依赖与构建性能优化
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Feb 21, 2022
1 parent edcfac9 commit a92b82d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"vite-plugin-inspect": "^0.3.14",
"vite-plugin-md": "^0.11.8",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-optimize-persist": "^0.1.2",
"vite-plugin-package-config": "^0.1.1",
"vite-plugin-pages": "^0.19.9",
"vite-plugin-restart": "^0.1.1",
"vite-plugin-vue-layouts": "^0.5.0",
Expand All @@ -72,5 +74,17 @@
"@types/markdown-it"
]
}
},
"vite": {
"optimizeDeps": {
"include": [
"@vueuse/core",
"nprogress",
"pinia",
"vue",
"vue-i18n",
"vue-router"
]
}
}
}
29 changes: 29 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions presets/tov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ import {
VueUseComponentsResolver
} from 'unplugin-vue-components/resolvers'
import { restart } from './shared/restart'
import OptimizationPersist from 'vite-plugin-optimize-persist'
import PkgConfig from 'vite-plugin-package-config'

const markdownWrapperClasses =
'prose md:prose-lg lg:prose-lg dark:prose-invert text-left p-10 prose-slate prose-img:rounded-xl prose-headings:underline prose-a:text-blue-600'

export default () => {
return [
// 将包信息文件作为 vite 的配置文件之一,为 vite-plugin-optimize-persist 所用
PkgConfig(),
// 依赖预构建分析,提高大型项目性能
OptimizationPersist(),
// vue 官方插件,用来解析 sfc
Vue({
include: [/\.vue$/, /\.md$/]
Expand Down

0 comments on commit a92b82d

Please sign in to comment.