Skip to content

Commit

Permalink
Merge pull request #102 from xoob/patch-1
Browse files Browse the repository at this point in the history
Fix invalid regex in getWorkerUrl
  • Loading branch information
alexdima authored Mar 2, 2020
2 parents 9548c68 + 88eef5d commit 8cd0490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function createLoaderRules(languages: IFeatureDefinition[], features: IFeatureDe
getWorkerUrl: function (moduleId, label) {
var pathPrefix = ${pathPrefix};
var result = (pathPrefix ? stripTrailingSlash(pathPrefix) + '/' : '') + paths[label];
if (/^((http:)|(https:)|(file:)|(\/\/))/.test(result)) {
if (/^((http:)|(https:)|(file:)|(\\/\\/))/.test(result)) {
var currentUrl = String(window.location);
var currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length);
if (result.substring(0, currentOrigin.length) !== currentOrigin) {
Expand Down

0 comments on commit 8cd0490

Please sign in to comment.