From 10564151f9d912f03148db41b365c8825e9677a3 Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Tue, 24 Feb 2026 15:36:04 +0800 Subject: [PATCH] fix: doc config for utoopack node api --- content/en/utoopack/index.mdx | 62 +++++++++++++++++++---------------- content/zh/utoopack/index.mdx | 62 +++++++++++++++++++---------------- 2 files changed, 68 insertions(+), 56 deletions(-) diff --git a/content/en/utoopack/index.mdx b/content/en/utoopack/index.mdx index ac66317..44bb7b9 100644 --- a/content/en/utoopack/index.mdx +++ b/content/en/utoopack/index.mdx @@ -32,20 +32,23 @@ const { build } = require('@utoo/pack'); 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 + } }); } @@ -58,20 +61,23 @@ const { dev } = require('@utoo/pack'); async function startDev() { const server = await dev({ - mode: "development", - 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 + } }); } diff --git a/content/zh/utoopack/index.mdx b/content/zh/utoopack/index.mdx index 65b0bf2..0789c3f 100644 --- a/content/zh/utoopack/index.mdx +++ b/content/zh/utoopack/index.mdx @@ -32,20 +32,23 @@ const { build } = require('@utoo/pack'); 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 + } }); } @@ -58,20 +61,23 @@ const { dev } = require('@utoo/pack'); async function startDev() { const server = await dev({ - mode: "development", - 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 + } }); }