From ce7d45ce63c3c6de5b321145de8db865ddd00c8a Mon Sep 17 00:00:00 2001 From: Ming Date: Fri, 3 Nov 2023 14:33:33 +0800 Subject: [PATCH] fix: add client data to dependencies (#4909) --- .changeset/chilly-guests-reply.md | 6 ++++++ packages/cli/plugin-data-loader/src/cli/loader.ts | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/chilly-guests-reply.md diff --git a/.changeset/chilly-guests-reply.md b/.changeset/chilly-guests-reply.md new file mode 100644 index 000000000000..c0666d1dcbd2 --- /dev/null +++ b/.changeset/chilly-guests-reply.md @@ -0,0 +1,6 @@ +--- +'@modern-js/plugin-data-loader': patch +--- + +fix: add client data into dependencies +fix: 添加 client data 文件到 dependencies 中 diff --git a/packages/cli/plugin-data-loader/src/cli/loader.ts b/packages/cli/plugin-data-loader/src/cli/loader.ts index d4b6832c0323..feec63c15c88 100644 --- a/packages/cli/plugin-data-loader/src/cli/loader.ts +++ b/packages/cli/plugin-data-loader/src/cli/loader.ts @@ -50,6 +50,8 @@ export default async function loader( ? this.resourcePath.replace('.loader.', '.data.client.') : this.resourcePath.replace('.data.', '.data.client.'); + this.addDependency(clientDataPath); + const clientDataContent = await readFile(clientDataPath); return clientDataContent; } catch (error) {