16 lines
665 B
JavaScript
16 lines
665 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 {
|
|
pack(options.dest);
|
|
Editor.log('[cloud-rise-package] 已合并为一个微信分包,保留四个 Bundle');
|
|
callback();
|
|
} catch (error) { Editor.error(error); callback(error); }
|
|
}
|
|
module.exports = {
|
|
load() { Editor.Builder.on('build-finished', onBuildFinished); },
|
|
unload() { Editor.Builder.removeListener('build-finished', onBuildFinished); }
|
|
};
|