feat(mp-harmony): 完善鸿蒙小程序项目适配与新增功能
1. 新增MP-HARMONY平台编译支持 2. 新增大量自定义组件、页面与工具页面 3. 调整站点配置与应用名称 4. 清理冗余静态资源与旧组件配置
This commit is contained in:
@@ -19,6 +19,22 @@ const path = require('path');
|
||||
const { openFileDirectory } = require('./open-directory');
|
||||
const { createZipWithSystemCommand } = require('./create-zip');
|
||||
|
||||
async function syncSiteToStub(mode = 'production') {
|
||||
try {
|
||||
const cwd = path.join(__dirname, '..');
|
||||
const srcSitePath = path.join(cwd, 'site.js');
|
||||
const stubSitePath = path.join(cwd, 'stub-app-projects', 'mp-harmony', 'ascf', 'ascf_src', 'site.js');
|
||||
|
||||
if (await exists(srcSitePath)) {
|
||||
await fsp.copyFile(srcSitePath, stubSitePath);
|
||||
console.log('site.js 已同步到 stub 项目源码目录');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('同步 site.js 到 stub 失败:', err);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
async function copyAssets(mode = 'production') {
|
||||
try {
|
||||
const cwd = path.join(__dirname, '..');
|
||||
@@ -71,6 +87,9 @@ async function main() {
|
||||
options.mode = argv[modeIndex + 1];
|
||||
}
|
||||
|
||||
// 同步 site.js 到 stub 项目源码目录,确保编译时能动态导入
|
||||
await syncSiteToStub(options.mode);
|
||||
|
||||
await copyAssets(options.mode);
|
||||
|
||||
if (!options.noZip && options.mode === 'production') {
|
||||
|
||||
Reference in New Issue
Block a user