fix: 补全小程序媒体地址并支持构建注入 AppID
This commit is contained in:
1 parent
5c6ad02f46
commit
07629a4596
4 files changed
+18
-10
No files matched your search
@@ -17,6 +17,7 @@ const templates = fs
|
||||
const key = process.env.TEMPLATE_KEY || templates[0];
|
||||
if (!key) throw new Error("No Taro template package found");
|
||||
if (!templates.includes(key)) throw new Error(`Unsupported Taro template: ${key}`);
|
||||
process.env.TARO_APP_ID ||= process.env.WEAPP_APP_ID;
|
||||
const template = path.join(root, "packages", `template-${key}`);
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(template, "template.json"), "utf8")) as {
|
||||
packageKey: string;
|
||||
@@ -60,14 +61,6 @@ export default defineConfig({
|
||||
to: `dist/template-preview/h5/assets/${templateKey}`,
|
||||
}))
|
||||
: []),
|
||||
...(process.env.TARO_ENV === "weapp"
|
||||
? [
|
||||
{
|
||||
from: path.resolve(__dirname, "../project.config.json"),
|
||||
to: `dist/${key}/weapp/project.config.json`,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(!previewAllTemplates
|
||||
? [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user