Skip to content

Commit

Permalink
chore(presets): 调整预设架构
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Mar 5, 2022
1 parent f0fc35c commit 4519616
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# 标题
VITE_APP_TITLE = Vite App 🦕


# 开发时 Inspect 调试支持
VITE_APP_INSPECT = true


# 生产时 mock 支持
VITE_APP_MOCK_IN_PRODUCTION = false


# api 自动按需引入
# 注意设置关闭时,项目级 api 自动按需引入也将自动关闭
# 注意设置关闭时,其他的 api 自动按需引入也将自动关闭
VITE_APP_API_AUTO_IMPORT = true


Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions presets/tov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import {
} from 'unplugin-vue-components/resolvers'
import OptimizationPersist from 'vite-plugin-optimize-persist'
import PkgConfig from 'vite-plugin-package-config'
import { GenerateTitle } from './shared/html'
import { FixLayoutsHmr } from './shared/layouts'
import { GenerateTitle } from './plugins/html'
import { FixLayoutsHmr } from './plugins/layouts'
import { AutoImportResolvers } from './shared/resolvers'

const markdownWrapperClasses =
Expand Down Expand Up @@ -90,7 +90,9 @@ export default () => {
]
}),
// 目录下 api 按需自动引入辅助插件
env.VITE_APP_DIR_API_AUTO_IMPORT && DirResolverHelper(),
env.VITE_APP_API_AUTO_IMPORT &&
env.VITE_APP_DIR_API_AUTO_IMPORT &&
DirResolverHelper(),
// api 自动按需引入
env.VITE_APP_API_AUTO_IMPORT &&
AutoImport({
Expand Down

0 comments on commit 4519616

Please sign in to comment.