text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=exports.compilePlugin=void 0;const tslib_1=require("tslib"),path_1=(0,tslib_1.__importDefault)(require("path")),projectconfig_1=require("../json/projectconfig"),common_1=require("./common"),plugin_1=require("../json/plugin/plugin"),game_1=require("./game"),white_ext_list_1=require("../../utils/white_ext_list");async function compilePlugin(e,i){const t=await(0,projectconfig_1.getProjectConfigJSON)(e),o=t.pluginRoot,{GameWhiteList:n}=await(0,white_ext_list_1.getWhiteExtList)(),l=e.getFileList(o,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,t,o)).filter(e=>n.has(path_1.default.posix.extname(e))),a=await(0,plugin_1.getDevPluginJSON)(e,!1),s=l.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(o,e)),p=await(0,common_1.compileJSFiles)(e,s,o,i),c=l.filter(e=>".js"!==path_1.default.posix.extname(e)&&e!==path_1.default.posix.join(o,"plugin.json")),r=await(0,common_1.compileOther)(e,c,i);return Object.assign(Object.assign({[path_1.default.posix.join(o,"plugin.json")]:JSON.stringify(a)},p),r)}async function compile(e,i){const t=await(0,projectconfig_1.getProjectConfigJSON)(e),o=await compilePlugin(e,i),n=await(0,game_1.compile)(e,i),l=await(0,common_1.getUploadProjectConfig)(e,t);return l.__compileDebugInfo__=i.__compileDebugInfo__||{},Object.assign(Object.assign(Object.assign({},o),n),{"project.config.json":JSON.stringify(l)})}exports.compilePlugin=compilePlugin,exports.compile=compile;