@arms/rum-bundler-plugin-core
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -686,23 +686,22 @@ (function (global, factory) { | ||
matchResult = sourceFileContent.match(/^(?:\s*|\/\*(?:.|\r|\n)*?\*\/|\/\/.*[\n\r])*(?:"[^"]*";|'[^']*';)?/); | ||
if (matchResult) { | ||
if (matchResult !== null && matchResult !== void 0 && matchResult[0]) { | ||
len = matchResult[0].length; | ||
newContent = sourceFileContent.slice(0, len - 1) + debugIdSnippet + sourceFileContent.slice(len); | ||
newContent = sourceFileContent.slice(0, len) + debugIdSnippet + sourceFileContent.slice(len); | ||
} | ||
} else { | ||
newContent = debugIdSnippet + sourceFileContent; | ||
} | ||
_context3.next = 6; | ||
newContent = newContent || debugIdSnippet + sourceFileContent; | ||
_context3.next = 7; | ||
return fs__namespace.writeFile(sourceFilePath, newContent); | ||
case 6: | ||
_context3.next = 11; | ||
case 7: | ||
_context3.next = 12; | ||
break; | ||
case 8: | ||
_context3.prev = 8; | ||
case 9: | ||
_context3.prev = 9; | ||
_context3.t0 = _context3["catch"](0); | ||
throw new Error("Failed to write UUID to file ".concat(sourceFilePath, ": ").concat(_context3.t0.message)); | ||
case 11: | ||
case 12: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
}, _callee3, null, [[0, 8]]); | ||
}, _callee3, null, [[0, 9]]); | ||
})); | ||
@@ -709,0 +708,0 @@ return _injectUUIDIntoSourceFile.apply(this, arguments); |
{ | ||
"name": "@arms/rum-bundler-plugin-core", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "rum bundler plugin core", | ||
@@ -5,0 +5,0 @@ "author": "ly403664 <ly403664@alibaba-inc.com>", |
30835
762