mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
perf(theme): improve findConfigPath (#246)
This commit is contained in:
parent
84c1ae39a1
commit
1444af6533
@ -20,11 +20,13 @@ export async function findConfigPath(app: App, configPath?: string): Promise<str
|
||||
return path
|
||||
}
|
||||
}
|
||||
extensions.forEach((ext) => {
|
||||
paths.push(resolve(cwd, `./${CONFIG_FILE_NAME}.${ext}`))
|
||||
paths.push(resolve(cwd, `${source}/${CONFIG_FILE_NAME}.${ext}`))
|
||||
paths.push(resolve(cwd, `./.vuepress/${CONFIG_FILE_NAME}.${ext}`))
|
||||
})
|
||||
extensions.forEach(ext =>
|
||||
paths.push(
|
||||
resolve(cwd, `${source}/${CONFIG_FILE_NAME}.${ext}`),
|
||||
resolve(cwd, `./${CONFIG_FILE_NAME}.${ext}`),
|
||||
resolve(cwd, `./.vuepress/${CONFIG_FILE_NAME}.${ext}`),
|
||||
),
|
||||
)
|
||||
let current: string | undefined
|
||||
for (const path of paths) {
|
||||
if (existsSync(path) && (await fsp.stat(path)).isFile()) {
|
||||
|
||||
@ -38,7 +38,7 @@ export function getPlugins({
|
||||
hostname,
|
||||
cache,
|
||||
}: SetupPluginOptions): PluginConfig {
|
||||
const isProd = !app.env.isDev
|
||||
const isProd = app.env.isBuild
|
||||
|
||||
const plugins: PluginConfig = [
|
||||
markdownTitlePlugin(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user