From dff482557d868b2edca667320f950cadd3acf6f8 Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Tue, 24 Feb 2026 15:19:49 +0800 Subject: [PATCH 1/2] fix(pack): output_root & doc update --- crates/pack-api/src/project.rs | 2 +- packages/pack/README.md | 64 ++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/crates/pack-api/src/project.rs b/crates/pack-api/src/project.rs index a079aff30a..47cbcb4115 100644 --- a/crates/pack-api/src/project.rs +++ b/crates/pack-api/src/project.rs @@ -934,7 +934,7 @@ impl Project { Ok(get_client_chunking_context(ClientChunkingContextOptions { mode: self.mode(), root_path: self.project_path().owned().await?, - output_root: self.dist_root().owned().await?, + output_root: self.client_root().owned().await?, output_root_to_root_path: (*output_root_to_root_path).clone(), public_path: self.config().computed_public_path(), environment: self.client_compile_time_info().environment(), diff --git a/packages/pack/README.md b/packages/pack/README.md index ea0c0a33bc..6c60e515b9 100644 --- a/packages/pack/README.md +++ b/packages/pack/README.md @@ -46,44 +46,46 @@ const { build, dev } = require('@utoo/pack'); // Production build async function runBuild() { await build({ - mode: "production", - entry: [ - { - import: "./src/index.ts", - html: { - template: "./index.html" - } - } - ], - output: { - path: "./dist", - filename: "[name].[contenthash:8].js", - chunkFilename: "[name].[contenthash:8].js", - clean: true - }, - sourceMaps: true + config: { + entry: [ + { + import: "./src/index.ts", + html: { + template: "./index.html" + } + } + ], + output: { + path: "./dist", + filename: "[name].[contenthash:8].js", + chunkFilename: "[name].[contenthash:8].js", + clean: true + }, + sourceMaps: true + } }); } // Development mode with HMR async function startDev() { const server = await dev({ - mode: "development", - entry: [ - { - import: "./src/index.ts", - html: { - template: "./index.html" + config: { + entry: [ + { + import: "./src/index.ts", + html: { + template: "./index.html" + } } - } - ], - output: { - path: "./dist", - filename: "[name].[contenthash:8].js", - chunkFilename: "[name].[contenthash:8].js", - clean: true - }, - sourceMaps: true + ], + output: { + path: "./dist", + filename: "[name].[contenthash:8].js", + chunkFilename: "[name].[contenthash:8].js", + clean: true + }, + sourceMaps: true + } }); } ``` From dff20284a24f411555002180954623ef6d6b1894 Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Tue, 24 Feb 2026 15:23:08 +0800 Subject: [PATCH 2/2] chore: fmt readme --- packages/pack/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/pack/README.md b/packages/pack/README.md index 6c60e515b9..5967730c48 100644 --- a/packages/pack/README.md +++ b/packages/pack/README.md @@ -48,12 +48,12 @@ async function runBuild() { await build({ config: { entry: [ - { - import: "./src/index.ts", - html: { - template: "./index.html" - } + { + import: "./src/index.ts", + html: { + template: "./index.html" } + } ], output: { path: "./dist",