MatchMaster/packages/cloud-rise-package/main.js
2026-09-24 16:50:43 +08:00

16 lines
746 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const { pack } = require('./pack');
function onBuildFinished(options, callback) {
// Creator 2.4 GUI builds use platform="mini-game", actualPlatform="wechatgame".
if ((options.actualPlatform || options.platform) !== 'wechatgame') return callback();
try {
const result = pack(options.dest);
Editor.log('[cloud-rise-package] 已生成百人赛 5 个独立远程 Bundle,版本:' + result.version + ',待上传目录:' + result.publishDir);
callback();
} catch (error) { Editor.error(error); callback(error); }
}
module.exports = {
load() { Editor.Builder.on('build-finished', onBuildFinished); },
unload() { Editor.Builder.removeListener('build-finished', onBuildFinished); }
};