ember-cli / broccoli-asset-rewrite

Broccoli plugin to rewrite a source tree from an asset map.
MIT License
10 stars 53 forks source link

Regex for matching assetPath picks up noise in certain cases #65

Closed gojefferson closed 6 years ago

gojefferson commented 6 years ago

Assume that assetPath (in rewriteAssetPath) is "popper.js.map", and assume that string contains the following substring:

er.placements = placements;
Popper.Defaults = Defaults;

return Popper;

})));
//# sourceMappingURL=popper.js.map

}
;if (typeof FastBoot === 'undefined') {
/*!
 * clipboard.js v1.7.1
 * https://zenor

The existing regex will make the following match:

popper.js.map

}
;if

Which causes the following line to break:

replaceString = this.prepend + removeLeadingRelativeOrSlashRegex.exec(replaceString)[2];

I've proposed a solution in a PR: https://github.com/rickharrison/broccoli-asset-rewrite/pull/64