Skip to content

Commit

Permalink
add extensions on calling addDefaultImport(), not in the function.
Browse files Browse the repository at this point in the history
  • Loading branch information
shimataro authored and nicolo-ribaudo committed Dec 6, 2019
1 parent 42e95c0 commit fdf5c74
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/babel-plugin-transform-runtime/src/index.js
Expand Up @@ -234,7 +234,7 @@ export default declare((api, options, dirname) => {
: "helpers";

return this.addDefaultImport(
`${modulePath}/${helpersDir}/${name}`,
`${modulePath}/${helpersDir}/${name}.js`,
name,
blockHoist,
);
Expand All @@ -254,7 +254,7 @@ export default declare((api, options, dirname) => {
if (cached) {
cached = t.cloneNode(cached);
} else {
cached = addDefault(file.path, `${source}.js`, {
cached = addDefault(file.path, source, {
importedInterop: "uncompiled",
nameHint,
blockHoist,
Expand All @@ -275,7 +275,7 @@ export default declare((api, options, dirname) => {
if (name === "regeneratorRuntime" && useRuntimeRegenerator) {
path.replaceWith(
this.addDefaultImport(
`${modulePath}/regenerator/index`,
`${modulePath}/regenerator/index.js`,
"regeneratorRuntime",
),
);
Expand All @@ -291,7 +291,7 @@ export default declare((api, options, dirname) => {
// transform global built-ins like `Symbol()`, `new Promise`
path.replaceWith(
this.addDefaultImport(
`${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,
`${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`,
name,
),
);
Expand Down Expand Up @@ -332,7 +332,7 @@ export default declare((api, options, dirname) => {
node.callee = t.memberExpression(
t.callExpression(
this.addDefaultImport(
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`,
`${propertyName}InstanceProperty`,
),
[context2],
Expand All @@ -354,7 +354,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${modulePath}/core-js/get-iterator`,
`${modulePath}/core-js/get-iterator.js`,
"getIterator",
),
[object],
Expand All @@ -371,7 +371,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${modulePath}/core-js/is-iterable`,
`${modulePath}/core-js/is-iterable.js`,
"isIterable",
),
[path.node.right],
Expand Down Expand Up @@ -399,7 +399,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${moduleName}/core-js/get-iterator-method`,
`${moduleName}/core-js/get-iterator-method.js`,
"getIteratorMethod",
),
[object],
Expand Down Expand Up @@ -427,7 +427,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`,
`${propertyName}InstanceProperty`,
),
[object],
Expand All @@ -439,7 +439,7 @@ export default declare((api, options, dirname) => {

path.replaceWith(
this.addDefaultImport(
`${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`,
`${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}.js`,
`${objectName}$${propertyName}`,
),
);
Expand All @@ -460,7 +460,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.memberExpression(
this.addDefaultImport(
`${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,
`${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`,
name,
),
node.property,
Expand Down

0 comments on commit fdf5c74

Please sign in to comment.