Small tweaks

This commit is contained in:
Michael Jackson
2018-04-03 22:32:32 -07:00
parent 7a9dfd2260
commit fac3f4c5be
9 changed files with 33 additions and 29 deletions

View File

@ -1,7 +1,7 @@
const URL = require("whatwg-url");
const warning = require("warning");
const BareIdentifierFormat = /^((?:@[^\/]+\/)?[^\/]+)(\/.*)?$/;
const bareIdentifierFormat = /^((?:@[^\/]+\/)?[^\/]+)(\/.*)?$/;
function unpkgRewriteBabelPlugin(dependencies = {}) {
return {
@ -22,7 +22,7 @@ function unpkgRewriteBabelPlugin(dependencies = {}) {
path.node.source.value = `${path.node.source.value}?module`;
} else {
// "bare" identifier
const match = BareIdentifierFormat.exec(path.node.source.value);
const match = bareIdentifierFormat.exec(path.node.source.value);
const packageName = match[1];
const file = match[2] || "";