16 lines
746 B
JavaScript
16 lines
746 B
JavaScript
'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); }
|
||
};
|