feat: 收口小程序构建上传阶段

This commit is contained in:
que01 committed 2026-10-17 18:01:38 +08:00
1 parent 6420b85019
commit ec16fff70e
23 files changed
+1185 -104

No files matched your search

+4 -4
View File
@@ -28,6 +28,8 @@ const templateApp = JSON.parse(
fs.readFileSync(path.join(template, "miniapp/app.json"), "utf8"),
) as { tabBar?: { color?: string; selectedColor?: string; backgroundColor?: string } };
const brand = process.env.BRAND_SLUG || manifest.defaultBrandSlug || "default-brand";
const buildOutputRoot =
process.env.MINIAPP_OUTPUT_ROOT || `dist/${key}/${process.env.TARO_ENV || "weapp"}`;
fs.cpSync(path.join(template, "miniapp/assets"), path.resolve(__dirname, "../src/assets"), {
recursive: true,
});
@@ -37,9 +39,7 @@ export default defineConfig({
designWidth: 750,
deviceRatio: { 750: 1 },
sourceRoot: "src",
outputRoot: previewAllTemplates
? "dist/template-preview/h5"
: `dist/${key}/${process.env.TARO_ENV || "weapp"}`,
outputRoot: previewAllTemplates ? "dist/template-preview/h5" : buildOutputRoot,
framework: "react",
compiler: { type: "vite" },
plugins: [],
@@ -69,7 +69,7 @@ export default defineConfig({
? [
{
from: path.join(template, "miniapp/assets"),
to: `dist/${key}/${process.env.TARO_ENV || "weapp"}/assets`,
to: `${buildOutputRoot}/assets`,
},
]
: []),