Skip to content

Commit

Permalink
Use top-evel Babel deps to build babel-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed May 8, 2024
1 parent 4e399b3 commit b38c3b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/babel-helpers/scripts/generate-helpers.js
Expand Up @@ -3,8 +3,7 @@ import fs from "fs";
import { join } from "path";
import { URL, fileURLToPath } from "url";
import { minify } from "terser";
import { transformSync } from "@babel/core";
import presetTypescript from "@babel/preset-typescript";
import { babel, presetTypescript } from "$repo-utils/babel-top-level";
import { gzipSync } from "zlib";
import { IS_BABEL_8 } from "$repo-utils";

Expand Down Expand Up @@ -59,7 +58,7 @@ export default Object.freeze({
const mangleFns = code.includes("@mangleFns");
const noMangleFns = [];

code = transformSync(code, {
code = babel.transformSync(code, {
configFile: false,
babelrc: false,
filename: filePath,
Expand Down
2 changes: 2 additions & 0 deletions scripts/repo-utils/babel.js
@@ -0,0 +1,2 @@
export * as babel from "@babel/core";
export { default as presetTypescript } from "@babel/preset-typescript";
6 changes: 5 additions & 1 deletion scripts/repo-utils/package.json
@@ -1,4 +1,8 @@
{
"type": "module",
"main": "index.cjs"
"main": "index.cjs",
"exports": {
".": "./index.cjs",
"./babel-top-level": "./babel.js"
}
}

0 comments on commit b38c3b6

Please sign in to comment.