Prepare @babel/core for asynchronicity (#10507)

* Prepare @babel/core for asynchronicity

* Include regenerator-runtime in standalone build

* Fix rollup build
This commit is contained in:
Nicolò Ribaudo
2020-01-10 22:44:13 +01:00
committed by GitHub
parent 9fec528016
commit 282f81bd67
46 changed files with 1363 additions and 648 deletions

View File

@@ -37,13 +37,20 @@ module.exports = function() {
return null;
},
resolveId(importee) {
let packageFolderName;
const matches = importee.match(/^@babel\/([^/]+)$/);
if (matches) {
packageFolderName = `babel-${matches[1]}`;
if (importee === "@babel/runtime/regenerator") {
return path.join(
dirname,
"packages",
"babel-runtime",
"regenerator",
"index.js"
);
}
if (packageFolderName) {
const matches = importee.match(/^@babel\/([^/]+)$/);
if (matches) {
const packageFolderName = `babel-${matches[1]}`;
// resolve babel package names to their src index file
const packageFolder = path.join(dirname, "packages", packageFolderName);
const packageJson = require(path.join(packageFolder, "package.json"));