Small tweaks
This commit is contained in:
parent
ab3e5f4dfc
commit
ab72779cfb
|
@ -1,7 +1,7 @@
|
||||||
const URL = require("whatwg-url");
|
const URL = require("whatwg-url");
|
||||||
const warning = require("warning");
|
const warning = require("warning");
|
||||||
|
|
||||||
const config = require("../config");
|
const origin = require("../config").origin;
|
||||||
|
|
||||||
const bareIdentifierFormat = /^((?:@[^/]+\/)?[^/]+)(\/.*)?$/;
|
const bareIdentifierFormat = /^((?:@[^/]+\/)?[^/]+)(\/.*)?$/;
|
||||||
|
|
||||||
|
@ -35,10 +35,9 @@ function unpkgRewrite(dependencies = {}) {
|
||||||
);
|
);
|
||||||
|
|
||||||
const version = dependencies[packageName] || "latest";
|
const version = dependencies[packageName] || "latest";
|
||||||
|
const url = `${origin}/${packageName}@${version}${file}?module`;
|
||||||
|
|
||||||
path.node.source.value = `${
|
path.node.source.value = url;
|
||||||
config.origin
|
|
||||||
}/${packageName}@${version}${file}?module`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue