@arms/rum-bundler-plugin-core
Advanced tools
Comparing version
@@ -803,3 +803,3 @@ (function (global, factory) { | ||
if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) { | ||
_context.next = 37; | ||
_context.next = 41; | ||
break; | ||
@@ -814,20 +814,23 @@ } | ||
debugId = getExistedDebugId(jsFileContent); | ||
logger.debug("debugId has been injected: ".concat(jsFilePath, " ").concat(debugId)); | ||
if (debugId) { | ||
_context.next = 19; | ||
_context.next = 21; | ||
break; | ||
} | ||
logger.debug("No debugId found in ".concat(jsFilePath)); | ||
return _context.abrupt("return"); | ||
case 19: | ||
_context.next = 21; | ||
case 21: | ||
_context.next = 23; | ||
return findSourceMapPath(jsFileContent, jsFilePath); | ||
case 21: | ||
case 23: | ||
sourceMapPath = _context.sent; | ||
logger.debug("sourcemap file path: ".concat(sourceMapPath)); | ||
if (!sourceMapPath) { | ||
_context.next = 29; | ||
_context.next = 32; | ||
break; | ||
} | ||
sourceMapCount++; | ||
_context.next = 26; | ||
_context.next = 29; | ||
return injectDebugIdToSourceMap(sourceMapPath, debugId); | ||
case 26: | ||
case 29: | ||
res = _context.sent; | ||
@@ -840,42 +843,43 @@ _ref2 = res || {}, _ref2$fileSize = _ref2.fileSize, fileSize = _ref2$fileSize === void 0 ? 0 : _ref2$fileSize; | ||
}); | ||
case 29: | ||
_context.next = 34; | ||
case 32: | ||
_context.next = 38; | ||
break; | ||
case 31: | ||
_context.prev = 31; | ||
case 34: | ||
_context.prev = 34; | ||
_context.t0 = _context["catch"](12); | ||
return _context.abrupt("continue", 34); | ||
case 34: | ||
logger.error(_context.t0.message); | ||
return _context.abrupt("continue", 38); | ||
case 38: | ||
_iteratorAbruptCompletion = false; | ||
_context.next = 8; | ||
break; | ||
case 37: | ||
_context.next = 43; | ||
case 41: | ||
_context.next = 47; | ||
break; | ||
case 39: | ||
_context.prev = 39; | ||
case 43: | ||
_context.prev = 43; | ||
_context.t1 = _context["catch"](6); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 43: | ||
_context.prev = 43; | ||
_context.prev = 44; | ||
case 47: | ||
_context.prev = 47; | ||
_context.prev = 48; | ||
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) { | ||
_context.next = 48; | ||
_context.next = 52; | ||
break; | ||
} | ||
_context.next = 48; | ||
_context.next = 52; | ||
return _iterator["return"](); | ||
case 48: | ||
_context.prev = 48; | ||
case 52: | ||
_context.prev = 52; | ||
if (!_didIteratorError) { | ||
_context.next = 51; | ||
_context.next = 55; | ||
break; | ||
} | ||
throw _iteratorError; | ||
case 51: | ||
return _context.finish(48); | ||
case 52: | ||
return _context.finish(43); | ||
case 53: | ||
case 55: | ||
return _context.finish(52); | ||
case 56: | ||
return _context.finish(47); | ||
case 57: | ||
if (!sourceMapCount) { | ||
@@ -885,3 +889,3 @@ logger.warn('No source maps found for the bundle. Please ensure that source map generation is enabled in your bundler configuration'); | ||
if (!(uploader !== null && uploader !== void 0 && uploader.upload && successSourceMapArr.length)) { | ||
_context.next = 85; | ||
_context.next = 89; | ||
break; | ||
@@ -897,47 +901,47 @@ } | ||
_iterator2 = _createForOfIteratorHelper(successSourceMapArr); | ||
_context.prev = 59; | ||
_context.prev = 63; | ||
_iterator2.s(); | ||
case 61: | ||
case 65: | ||
if ((_step2 = _iterator2.n()).done) { | ||
_context.next = 77; | ||
_context.next = 81; | ||
break; | ||
} | ||
fileMetaData = _step2.value; | ||
_context.next = 65; | ||
_context.next = 69; | ||
return uploader.upload(fileMetaData, context); | ||
case 65: | ||
case 69: | ||
if (!clearSourceMap) { | ||
_context.next = 75; | ||
_context.next = 79; | ||
break; | ||
} | ||
filePath = fileMetaData.filePath; | ||
_context.prev = 67; | ||
_context.next = 70; | ||
_context.prev = 71; | ||
_context.next = 74; | ||
return removeFile(filePath); | ||
case 70: | ||
_context.next = 75; | ||
case 74: | ||
_context.next = 79; | ||
break; | ||
case 72: | ||
_context.prev = 72; | ||
_context.t2 = _context["catch"](67); | ||
case 76: | ||
_context.prev = 76; | ||
_context.t2 = _context["catch"](71); | ||
logger.error("Error deleting file ".concat(filePath, " for ").concat(_context.t2.message)); | ||
case 75: | ||
_context.next = 61; | ||
case 79: | ||
_context.next = 65; | ||
break; | ||
case 77: | ||
_context.next = 82; | ||
case 81: | ||
_context.next = 86; | ||
break; | ||
case 79: | ||
_context.prev = 79; | ||
_context.t3 = _context["catch"](59); | ||
case 83: | ||
_context.prev = 83; | ||
_context.t3 = _context["catch"](63); | ||
_iterator2.e(_context.t3); | ||
case 82: | ||
_context.prev = 82; | ||
case 86: | ||
_context.prev = 86; | ||
_iterator2.f(); | ||
return _context.finish(82); | ||
case 85: | ||
return _context.finish(86); | ||
case 89: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee, null, [[6, 39, 43, 53], [12, 31], [44,, 48, 52], [59, 79, 82, 85], [67, 72]]); | ||
}, _callee, null, [[6, 43, 47, 57], [12, 34], [48,, 52, 56], [63, 83, 86, 89], [71, 76]]); | ||
})); | ||
@@ -944,0 +948,0 @@ return function handleUploadSourceMap(_x, _x2, _x3, _x4) { |
{ | ||
"name": "@arms/rum-bundler-plugin-core", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "rum bundler plugin core", | ||
@@ -5,0 +5,0 @@ "author": "ly403664 <ly403664@alibaba-inc.com>", |
46986
0.61%1172
0.34%