Fix incorrect module path when absoluteRuntime is specified (#11893)

* - Added failing tests for issue #11885.

* - Fix issue #11885: absoluteRuntime does not work as expected with corejs3.

* - Removed helper code from test output files (tests for issue #11885).

* chore: add @babel/runtime-corejs3 to dev deps

* chore: update test fixtures

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
This commit is contained in:
SZ-Coder
2020-07-30 16:35:37 +02:00
committed by GitHub
parent 164a93945d
commit 4ce1b70ade
8 changed files with 116 additions and 3 deletions

View File

@@ -310,7 +310,7 @@ export default declare((api, options, dirname) => {
node.callee = t.memberExpression(
t.callExpression(
this.addDefaultImport(
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${modulePath}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${propertyName}InstanceProperty`,
),
[context2],
@@ -379,7 +379,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${moduleName}/core-js/get-iterator-method`,
`${modulePath}/core-js/get-iterator-method`,
"getIteratorMethod",
),
[object],
@@ -407,7 +407,7 @@ export default declare((api, options, dirname) => {
path.replaceWith(
t.callExpression(
this.addDefaultImport(
`${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${modulePath}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,
`${propertyName}InstanceProperty`,
),
[object],