mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
fix(theme): incorrect context leading to failed theme config file hmr (#485)
This commit is contained in:
parent
4e0304e2a6
commit
ddc82895ab
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user