Skip to content

Commit

Permalink
Fix rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 5, 2022
1 parent bab5d82 commit d02aa87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions Gulpfile.mjs
Expand Up @@ -385,17 +385,6 @@ function buildRollup(packages, buildStandalone) {
return;
}
break;
case "NON_EXISTENT_EXPORT":
// babel-core/src/index.ts imports createRequire, but it's only
// used in the ESM build. We can safely ignore this warning.
if (
warning.id.endsWith("babel-core/src/index.ts") &&
warning.source === "\x00polyfill-node.module.js" &&
warning.name === "createRequire"
) {
return;
}
break;
}

// We use console.warn here since it prints more info than just "warn",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-core/src/index.ts
Expand Up @@ -89,11 +89,11 @@ export function Plugin(alias: string) {
);
}

import { createRequire } from "module";
import Module from "module";
import * as thisFile from "./index";
if (USE_ESM) {
// Pass this module to the CJS proxy, so that it
// can be synchronously accessed.
const cjsProxy = createRequire(import.meta.url)("../cjs-proxy.cjs");
const cjsProxy = Module.createRequire(import.meta.url)("../cjs-proxy.cjs");
cjsProxy["__ initialize @babel/core cjs proxy __"] = thisFile;
}

0 comments on commit d02aa87

Please sign in to comment.