WIP: address PR #475 review feedback

このコミットが含まれているのは:
codex-bot
2026-11-14 22:12:56 +09:00
コミット a636472ec3
6個のファイルの変更、55行の追加、15行の削除
+6 -5
ファイルの表示
@@ -159,10 +159,9 @@ export const helpAssets = (): Plugin => {
configResolved (config) {
state.root = path.resolve (config.root, 'help')
},
async buildStart () {
state.data = generateHelpAssets (state.root)
const generated = await data ()
generated.files.forEach (file => this.addWatchFile (file))
buildStart () {
state.data = undefined
this.addWatchFile (state.root)
},
resolveId (id) {
return id.startsWith (prefix) ? `\0${ id }` : null
@@ -170,7 +169,9 @@ export const helpAssets = (): Plugin => {
async load (id) {
if (!(id.startsWith (`\0${ prefix }`)))
return null
const source = (await data ()).modules.get (id.slice (1))
const generated = await data ()
generated.files.forEach (file => this.addWatchFile (file))
const source = generated.modules.get (id.slice (1))
if (source == null)
throw new Error (`Unknown Help asset: ${ id.slice (1) }`)
return source