UNPKG

fa-toolkit

Version:

a devtool for fast app

1 lines 2.44 kB
"use strict";var _0x295b34=_0x2dca;function _0x2dca(e,r){var o=_0x3f59();return(_0x2dca=function(e,r){return o[e-=333]})(e,r)}!function(){for(var e=_0x2dca,r=_0x3f59();;)try{if(988742==-parseInt(e(356))+-parseInt(e(353))/2*(parseInt(e(336))/3)+parseInt(e(344))/4+parseInt(e(362))/5+-parseInt(e(352))/6+-parseInt(e(355))/7*(-parseInt(e(366))/8)+parseInt(e(365))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}();var path=require("path"),fs=require("fs"),_require=require("./common/utils"),checkNodeVersion=_require[_0x295b34(339)],projectPath=process[_0x295b34(367)][_0x295b34(363)]||process[_0x295b34(340)](),quickAppConfigPath=path[_0x295b34(349)](projectPath,_0x295b34(358)),quickAppConfig=fs[_0x295b34(341)](quickAppConfigPath)?require(quickAppConfigPath):{},rootDir=path.join(projectPath,quickAppConfig[_0x295b34(346)]||_0x295b34(369)),existsSync=fs[_0x295b34(341)];function _0x3f59(){var e=["1182228lDiSJy","926xTLwEW","./web.webpack.config","9479498YqrTRy","1697587QDBURZ","toString","./quickapp.config.js","./fa.webpack.config","quickappRoot","_isQuickCardMode","2123600OmzaFH","projectRoot","quickapp.config.json","9195111uLHfnk","8FHeCue","env","readFileSync","src","openharmony","_isQuickApp","package.config.json","concat","8187RvpOYp","ERROR: The project structure is invalid.","v10.13.0","checkNodeVersion","cwd","existsSync","./quickcard.webpack.config","app.json","5385124gmxHcF","_dependComponents","sourceRoot","manifest.json","parse","join","exports","buildType"];return(_0x3f59=function(){return e})()}function getWebpackConfig(){var e=_0x295b34;checkNodeVersion(e(338),"Fa-Toolkit");var r=path[e(349)](projectPath,e(364));if(existsSync(r)){var o=existsSync(r)?JSON[e(348)](fs[e(368)](r)[e(357)]()):{},r=path[e(349)](projectPath,o.quickappRoot?o[e(360)]:""),o=path.join(r,e(343));if(!existsSync(o))throw"ERROR: Cant find module 'app.json' from "[e(335)](r,".");return require(e(354))}if(isFlexibleProject())return global._isFlexibleCardMode=!0,global[e(361)]=!0,global[e(345)]={},require(e(342));if(isOtherProject())return process[e(367)][e(351)]===e(370)&&(global._isHarmony=!0),global[e(333)]=!0,require(e(359));throw e(337)}function isOtherProject(){var e=_0x295b34,e=path[e(349)](rootDir,e(347));return existsSync(e)}function isFlexibleProject(){var e=path.join(rootDir,_0x295b34(334));return existsSync(e)}global[_0x295b34(361)]=!1,global._isFlexibleCardMode=!1,module[_0x295b34(350)]=getWebpackConfig();