Expose @babel/eslint-parser/experimental-worker (#13398)

* Expose `@babel/eslint-parser/experimental-worker`

* Fix `@babel/runtime` build on Windows
This commit is contained in:
Nicolò Ribaudo
2021-08-03 23:23:32 +02:00
committed by GitHub
parent 830b99dc83
commit 885e1e02f5
19 changed files with 305 additions and 197 deletions

View File

@@ -127,7 +127,7 @@ function writeHelperFile(
buildHelper(runtimeName, pkgDirname, fullPath, helperName, { esm, corejs })
);
return `./${filePath}`;
return esm ? `./helpers/esm/${fileName}` : `./helpers/${fileName}`;
}
function writeHelpers(runtimeName, { corejs } = {}) {
@@ -164,12 +164,13 @@ function writeHelpers(runtimeName, { corejs } = {}) {
// - Node.js <13.2.0 will fail resolving the first array entry, and will
// fallback to the second entry (the CJS file)
// In Babel 8 we can simplify this.
helperSubExports[`./${helperPath}`] = [
helperSubExports[`./${path.posix.join("helpers", helperName)}`] = [
{ node: cjs, import: esm, default: cjs },
cjs,
];
// For backward compatibility. We can remove this in Babel 8.
helperSubExports[`./${path.join("helpers", "esm", helperName)}`] = esm;
helperSubExports[`./${path.posix.join("helpers", "esm", helperName)}`] =
esm;
}
writeHelperExports(runtimeName, helperSubExports);