fix(theme): incorrect context leading to failed theme config file hmr (#485)

This commit is contained in:
pengzhanbo 2025-02-23 01:55:24 +08:00 committed by GitHub
parent 4e0304e2a6
commit ddc82895ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,9 @@ import type { FSWatcher } from 'chokidar'
import type { App } from 'vuepress'
import type { AutoFrontmatterOptions, EncryptOptions, PlumeThemeLocaleOptions } from '../../shared/index.js'
import type { ThemeConfig } from '../types.js'
import process from 'node:process'
import { deepMerge } from '@pengzhanbo/utils'
import { watch } from 'chokidar'
import { path } from 'vuepress/utils'
import { resolveLocaleOptions } from '../config/resolveLocaleOptions.js'
import { perfLog, perfMark } from '../utils/index.js'
import { compiler } from './compiler.js'
@ -86,7 +86,7 @@ export function watchConfigFile(app: App, watchers: any[], onChange: ChangeEvent
const watcher = watch(loader.configFile, {
ignoreInitial: true,
cwd: path.join(path.dirname(loader.configFile), '../'),
cwd: process.cwd(),
})
addDependencies(watcher)