From 890e9da3b3572cde533a013a2a9f21736adf9b39 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 9 Sep 2026 17:57:50 +0800 Subject: [PATCH] fix: track Rstack config files in Rslib --- packages/rstack/src/rslibConfig.ts | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/packages/rstack/src/rslibConfig.ts b/packages/rstack/src/rslibConfig.ts index a3159c63..cf581a1a 100644 --- a/packages/rstack/src/rslibConfig.ts +++ b/packages/rstack/src/rslibConfig.ts @@ -1,9 +1,9 @@ -import type { WatchFiles } from '@rsbuild/core'; import type { ConfigParams, RslibConfig, RslibConfigDefinition, } from '@rslib/core'; +import { withConfigMeta } from '@rstackjs/load-config'; import { loadRstackConfig, type Configs } from './config.ts'; const resolveRslibConfig = async ( @@ -24,30 +24,7 @@ const loadRslibConfig = (async (params: ConfigParams) => { const { configs, filePath, dependencies } = await loadRstackConfig(); const config = await resolveRslibConfig(configs, params); - if (!filePath) { - return config; - } - - const watchFiles = config.dev?.watchFiles; - const watchConfig: WatchFiles = { - paths: [filePath, ...dependencies], - type: 'restart', - }; - - return { - ...config, - dev: { - ...config.dev, - watchFiles: [ - ...(watchFiles - ? Array.isArray(watchFiles) - ? watchFiles - : [watchFiles] - : []), - watchConfig, - ], - }, - }; + return withConfigMeta(config, { filePath, dependencies }); }) as RslibConfigDefinition; export default loadRslibConfig;