/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/runtime-integration/generate-absolute-runtime.cjs
21 строка
738 B
liuxingbaoyu
Remove corejs exports for `@babe/runtime-corejs3` (#18036)
14 июн 2026, 11:23
Не верифицирован
14 июн 2026, 11:23
ef2a7aa
Код
Авторство
О чём код?
/* eslint-disable unicorn/prefer-node-protocol */ const fs = require("fs"); const path = require("path"); const runtimePath = path .resolve(__dirname, "../../packages/babel-runtime") .replace(/\\/g, "/"); const runtimeCorejs3Path = path .resolve(__dirname, "../../packages/babel-runtime-corejs3") .replace(/\\/g, "/"); const input = path.resolve(__dirname, "src"); for (const file of fs.readdirSync(input)) { if (!/\.[cm]js$/.test(file)) continue; let contents = fs.readFileSync(path.join(input, file), "utf8"); contents = contents.replace("@babel/runtime-corejs3", runtimeCorejs3Path); contents = contents.replace("@babel/runtime", runtimePath); fs.writeFileSync(path.resolve(input, "absolute", file), contents); }