diff --git a/packages/core/parcel-bundler/src/builtins/bundle-url.js b/packages/core/parcel-bundler/src/builtins/bundle-url.js index 5815b1dd033..533ba60c9f5 100644 --- a/packages/core/parcel-bundler/src/builtins/bundle-url.js +++ b/packages/core/parcel-bundler/src/builtins/bundle-url.js @@ -12,7 +12,7 @@ function getBundleURL() { try { throw new Error; } catch (err) { - var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g); + var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension):\/\/[^)\n]+/g); if (matches) { return getBaseURL(matches[0]); } @@ -22,7 +22,7 @@ function getBundleURL() { } function getBaseURL(url) { - return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/'; + return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension):\/\/.+)\/[^/]+$/, '$1') + '/'; } exports.getBundleURL = getBundleURLCached;