/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/babel-compat-data/scripts/build-data.mjs
36 строк
1 KB
Nicolò Ribaudo
Remove corejs2 and legacy files from compat-data (#17633)
08 дек 2025, 18:59
Не верифицирован
08 дек 2025, 18:59
3591b24
Код
Авторство
О чём код?
import browserCompatData from "@mdn/browser-compat-data" with { type: "json" }; import { generateModuleSupport } from "./build-modules-support.mjs"; import { generateData, environments, writeFile, maybeDefineLegacyPluginAliases, } from "./utils-build-data.mjs"; import pluginFeatures from "./data/plugin-features.mjs"; const compatData = browserCompatData.javascript; if (process.cwd().endsWith("scripts")) { throw new Error("Please run this script from the root of the package"); } function buildPluginFeatures() { // We ignore 'overlapping' here, because it's already generated by // built-bugfixes-targets.js which has a complete view over all the // plugins that we have data for. let { data: newData } = generateData(environments, pluginFeatures); // add export-namespace-from from @mdn/browser-compat-data newData["transform-export-namespace-from"] = generateModuleSupport( compatData.statements.export.namespace, true ); // Add proposal-* aliases for backward compatibility. newData = maybeDefineLegacyPluginAliases(newData); const dataURL = new URL(`../data/plugins.json`, import.meta.url); if (!writeFile(newData, dataURL, "plugin")) { throw new Error(`Cannot update ${dataURL}`); } } buildPluginFeatures();