UNPKG

fa-toolkit

Version:

a devtool for fast app

1 lines 7.3 kB
"use strict";var _0x3751d9=_0x41b2;function _0x41b2(r,e){var t=_0x4bfa();return(_0x41b2=function(r,e){return t[r-=125]})(r,e)}function _typeof(r){var t=_0x41b2;return(_typeof=t(149)==typeof Symbol&&t(169)==typeof Symbol[t(136)]?function(r){return typeof r}:function(r){var e=t;return r&&e(149)==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?e(169):typeof r})(r)}function _classCallCheck(r,e){if(!(r instanceof e))throw new TypeError(_0x41b2(188))}function _defineProperties(r,e){for(var t=_0x41b2,n=0;n<e.length;n++){var o=e[n];o[t(195)]=o[t(195)]||!1,o[t(192)]=!0,t(131)in o&&(o[t(170)]=!0),Object[t(204)](r,_toPropertyKey(o[t(175)]),o)}}function _createClass(r,e,t){var n=_0x41b2;return e&&_defineProperties(r.prototype,e),t&&_defineProperties(r,t),Object[n(204)](r,n(140),{writable:!1}),r}function _toPropertyKey(r){var e=_0x41b2,r=_toPrimitive(r,e(203));return _typeof(r)===e(169)?r:String(r)}function _toPrimitive(r,e){var t=_0x41b2;if(_typeof(r)!==t(182)||null===r)return r;var n=r[Symbol[t(187)]];if(void 0===n)return(e===t(203)?String:Number)(r);e=n[t(186)](r,e||t(183));if("object"!==_typeof(e))return e;throw new TypeError(t(132))}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){var t=_0x41b2;if(r){if("string"==typeof r)return _arrayLikeToArray(r,e);var n=Object.prototype.toString[t(186)](r).slice(8,-1);return"Map"===(n="Object"===n&&r[t(148)]?r[t(148)][t(197)]:n)||"Set"===n?Array[t(150)](r):n===t(160)||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(r,e):void 0}}function _iterableToArray(r){var e=_0x41b2;if(typeof Symbol!==e(179)&&null!=r[Symbol[e(136)]]||null!=r[e(137)])return Array[e(150)](r)}function _arrayWithoutHoles(r){if(Array[_0x41b2(163)](r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,e){var t=_0x41b2;(null==e||e>r[t(166)])&&(e=r[t(166)]);for(var n=0,o=new Array(e);n<e;n++)o[n]=r[n];return o}!function(){for(var r=_0x41b2,e=_0x4bfa();;)try{if(357850==-parseInt(r(144))*(parseInt(r(207))/2)+parseInt(r(161))/3+parseInt(r(164))/4*(-parseInt(r(139))/5)+-parseInt(r(153))/6+-parseInt(r(128))/7*(parseInt(r(181))/8)+parseInt(r(168))/9*(-parseInt(r(172))/10)+parseInt(r(142))/11*(parseInt(r(196))/12))break;e.push(e.shift())}catch(r){e.push(e.shift())}}();var TYPE=_0x3751d9(199);function defaultFormatter(r,e){return r.reduce(function(r,e){var t=_0x41b2;return[].concat(_toConsumableArray(r),["\n"[t(155)](e[t(189)])])},[])}function _0x4bfa(){var r=["Arguments","820467EyXgAD","dropRepeat","isArray","96172lcHqYX","warnings","length","compileTime: ","9UcMEDL","symbol","writable","hasWarnings","1526120ZrgNJJ","transformers","ModuleBuildError","key","error","assign","compilation","undefined","errors","120pxmRzQ","object","default","env","resource","call","toPrimitive","Cannot call a class as a function","message","ModuleNotFoundError","replace","configurable","calculate","BuildLogOutputPlugin","enumerable","12XWmKVl","name","ERROR: ","Module not found","true","forEach","warnCount","string","defineProperty","options","SyntaxError","1342512IwEwBF","reduce","SUCCESS ","printCompileResult","showCompileTime","\n@ ","\nCOMPILE RESULT:","141414UnRgLf","Error: ","map","value","@@toPrimitive must return a primitive value.","\nCOMPILE RESULT:SUCCESS ","hooks","getBuildMsg","iterator","@@iterator","errorCount","45lUghyQ","prototype","test","21388477mZWtDL","origin","1XSFeDh","formatters","(Emitted value instead of an instance of Error) ","startTime","constructor","function","from","warning","displayErrors","3100566vpoYsz","includes","concat","noteCount","warningCount","exports","some"];return(_0x4bfa=function(){return r})()}function babelSyntaxError(r){var e=_0x3751d9;return isBabelSyntaxError(r)&&(r[e(189)]=cleanStackTrace(r[e(189)])),r}function isBabelSyntaxError(r){var e=_0x3751d9;return r[e(197)]===e(174)&&r[e(189)][e(154)](e(206))}function cleanStackTrace(r){var e=_0x3751d9;return r[e(191)](/^\s*at\s.*:\d+:\d+[\s\)]*\n/gm,"").replace(/^Module build failed.*:\s/,e(129))}function moduleNotFoundError(r){var e,t=_0x3751d9;return r.name===t(190)&&r[t(189)].includes(TYPE)&&(r[t(189)]=r.message[t(191)](TYPE,t(198)[t(155)](TYPE)),(e=r[t(143)]&&r[t(143)][t(185)])&&(r[t(189)]+=t(126).concat(e))),r}var defaultFormatters=[defaultFormatter],defaultTransformers=[babelSyntaxError,moduleNotFoundError];function extractError(r){return{message:r.message,file:r.file,origin:r.origin,name:r[_0x3751d9(197)],severity:0,webpackError:r}}function cleanMessage(r){var e=_0x3751d9;return r[e(191)](e(146),"")[e(191)](/Module Warning[^\n]+\n/,"")[e(191)](/Module Error[^\n]+\n/,"")}function transformErrors(r,e){function t(r,e){return e(r)}return r.map(extractError).map(function(r){return e[_0x41b2(208)](t,r)})}function formatErrors(e,r,t){var n=_0x3751d9;return r[n(130)](function(r){return r(e,t)||[]})[n(208)](function(r,e){return r.concat(e)},[])}function getCompileTime(r){var e=_0x3751d9,t=r.endTime,r=r[e(147)];console.error(e(167)[e(155)](t-r," ms"))}function _dropRepeat(r){return r.reduce(function(r,e){var t=_0x41b2;return r[t(159)](function(r){return r.message===e.message})?r:r[t(155)](e)},[])}var BuildLogOutputPlugin=function(){var u=_0x3751d9;function n(){var r=_0x41b2,e=0<arguments[r(166)]&&void 0!==arguments[0]?arguments[0]:{},t=e.showCompileTime,t=void 0!==t&&t,e=e.options;_classCallCheck(this,n),this.errorCount=0,this[r(157)]=0,this.noteCount=0,this.showCompileTime=t||process[r(184)].showtime===r(200),this[r(145)]=defaultFormatters,this.transformers=defaultTransformers,this[r(205)]=e}return _createClass(n,[{key:"apply",value:function(r){var u=_0x41b2,s=this;r[u(134)].done.tap(u(194),function(e){var t=u;s.dropRepeat(e);var r=e[t(178)],n=r[t(180)],o=r.warnings,a=e.hasErrors(),i=e[t(171)]();setTimeout(function(){var r=t;a&&s[r(152)](n,r(176)),i&&s[r(152)](o,r(151)),s.calculate(e,n,o),s[r(210)](),s[r(125)]&&getCompileTime(e)})})}},{key:u(162),value:function(r){var e=u;r[e(178)][e(165)]=_dropRepeat(r.compilation[e(165)]),r[e(178)][e(180)]=_dropRepeat(r[e(178)].errors)}},{key:u(193),value:function(r,e){var t=u,n=this,o=2<arguments[t(166)]&&void 0!==arguments[2]?arguments[2]:[],a=r[t(178)].extraInfo||{},i=a[t(138)],r=void 0===i?0:i,i=a[t(202)],i=void 0===i?0:i,a=a[t(156)],a=void 0===a?0:a;this[t(138)]=e.length+r,this[t(157)]=i,this[t(156)]=a,o.forEach(function(r){var e=t,r=r.message;/^NOTE:/[e(141)](cleanMessage(r))?n[e(156)]++:n[e(157)]++})}},{key:u(210),value:function(){var r,e=u,t=this[e(138)],n=this[e(157)],o=this.noteCount;0<t+n+o?(r=t?"FAIL ":e(209),o=Object[e(177)]({},t?{ERROR:t}:{},n?{WARN:n}:{},o?{NOTE:o}:{}),console[e(176)](e(127).concat(r)[e(155)](JSON.stringify(o)))):console[e(176)](e(133))}},{key:u(152),value:function(r,e){var t=u;formatErrors(transformErrors(r,this[t(173)]),this.formatters,e)[t(201)](function(r){console.error(cleanMessage(r))})}},{key:u(135),value:function(r,e){var t=u;return formatErrors(transformErrors(r,this[t(173)]),this[t(145)],e)[t(130)](function(r){return cleanMessage(r)})}}]),n}();module[_0x3751d9(158)]=BuildLogOutputPlugin;