arco-scripts-babel-config

raw JSON →
1.0.0 verified Sat Apr 25 auth: no javascript

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.

error Error [ERR_REQUIRE_ESM]: require() of ES Module ... from ... not supported.
cause Using require() on an ESM-only package.
fix
Change to import or use dynamic import().
error TypeError: Cannot read properties of undefined (reading 'presets')
cause Babel config not correctly applied after importing.
fix
Ensure the config object is passed as module.exports in babel.config.js.
gotcha Package is ESM-only and cannot be required with CommonJS require().
fix Use dynamic import() or ensure your project is set to ESM.
gotcha This package is intended for internal use by Arco scripts; standalone usage may lead to unexpected behavior.
fix Use within an Arco Design project or fork the config.
deprecated No breaking changes yet; version 1.0.0 is initial. Be aware that future versions may change export shapes.
fix Pin version and check release notes before upgrading.
npm install arco-scripts-babel-config
yarn add arco-scripts-babel-config
pnpm add arco-scripts-babel-config

Shows default import and usage with options for custom targets.

import babelConfig from 'arco-scripts-babel-config';
// In .babelrc or babel.config.js:
module.exports = babelConfig;
// Or with options:
import { getBabelConfig } from 'arco-scripts-babel-config';
const config = getBabelConfig({ targets: '> 0.25%, not dead' });