Permalink
Browse files

fix(bundle): support quoteless script src attribute

Fixes #639

Makes the capture groups optional for single/double quotes in the source file regular expression.
  • Loading branch information...
AustinBrunkhorst committed Jun 4, 2017
1 parent fd07344 commit ffafbc9d002e614c183f9027d2fdf485d929a9ff
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/build/utils.js
View
@@ -63,11 +63,11 @@ exports.escapeForRegex = function(str) {
exports.createSrcFileRegex = function() {
let parts = Array.prototype.slice.call(arguments);
let regexString = "\\b(?:src=(\"|')(.*))(";
let regexString = "\\b(?:src=(\"|')?(.*))(";
for (let i = 0; i < parts.length; i ++) {
regexString = regexString + exports.escapeForRegex(parts[i]) + (i < (parts.length - 1) ? '(\/|\\\\)' : '');
}
regexString = regexString + "(.*?).js)(?:(\"|'))";
regexString = regexString + "(.*?).js)(?:(\"|')?)";
return new RegExp(regexString);
};

0 comments on commit ffafbc9

Please sign in to comment.