{"id":18963,"library":"arco-scripts-babel-config","title":"arco-scripts-babel-config","description":"A shared Babel configuration package used internally by Arco scripts (from the Arco Design team) for compiling modern JavaScript/TypeScript. Version 1.0.0 is the initial stable release. It provides a preset-based setup optimized for React/TypeScript projects, typically consumed via `@arco-design/arco-scripts`. Requires `@babel/core` and related Babel plugins as peer dependencies. Key differentiators: tightly coupled with the Arco ecosystem; no standalone usage intended; minimal configuration overhead for Arco-based projects.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install arco-scripts-babel-config","lang":"bash","label":"npm"},{"cmd":"yarn add arco-scripts-babel-config","lang":"bash","label":"yarn"},{"cmd":"pnpm add arco-scripts-babel-config","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel transformation.","package":"@babel/core","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require() will fail. Use dynamic import() if needed in CJS context.","wrong":"const babelConfig = require('arco-scripts-babel-config')","symbol":"default","correct":"import babelConfig from 'arco-scripts-babel-config'"},{"note":"TypeScript type import only; not a runtime value.","wrong":"import { BabelConfig } from 'arco-scripts-babel-config'","symbol":"BabelConfig","correct":"import type { BabelConfig } from 'arco-scripts-babel-config'"},{"note":"Named export for fetching config with options; also ESM-only.","wrong":"","symbol":"getBabelConfig","correct":"import { getBabelConfig } from 'arco-scripts-babel-config'"}],"quickstart":{"code":"import babelConfig from 'arco-scripts-babel-config';\n// In .babelrc or babel.config.js:\nmodule.exports = babelConfig;\n// Or with options:\nimport { getBabelConfig } from 'arco-scripts-babel-config';\nconst config = getBabelConfig({ targets: '> 0.25%, not dead' });","lang":"typescript","description":"Shows default import and usage with options for custom targets."},"warnings":[{"fix":"Use dynamic import() or ensure your project is set to ESM.","message":"Package is ESM-only and cannot be required with CommonJS require().","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use within an Arco Design project or fork the config.","message":"This package is intended for internal use by Arco scripts; standalone usage may lead to unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pin version and check release notes before upgrading.","message":"No breaking changes yet; version 1.0.0 is initial. Be aware that future versions may change export shapes.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import or use dynamic import().","cause":"Using require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... from ... not supported."},{"fix":"Ensure the config object is passed as module.exports in babel.config.js.","cause":"Babel config not correctly applied after importing.","error":"TypeError: Cannot read properties of undefined (reading 'presets')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}