Registry / devops / babel-preset-atomic

babel-preset-atomic

JSON →
library5.0.0jsnpmunverified

A Babel preset optimized for Electron and Node.js environments, maintained by atom-ide-community. Current stable version is 5.0.0 targeting Electron 11. Release cadence is irregular. Key differentiators: includes TypeScript, React, Flow support; configurable targets; previously bundled @babel/core as dependency (v4.1.0-4.3.0) but now requires peer dependencies. Supports both ESM and CJS.

npm install babel-preset-atomic
INSTALL
IMPORT
SIG · BABEL-PRESET-ATOMI
B
babel-preset-atomic
devopsjavascriptv5.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
module.exports = require('babel-preset-atomic')
import preset from 'babel-preset-atomic'
This is a Babel preset, not a regular module. It is used via Babel configuration, not imported directly in code. The correct usage is to add it to your .babelrc or babel.config.js as a preset entry.
preset
module.exports = { presets: ['babel-preset-atomic'] }
const preset = require('babel-preset-atomic').default
No default export; use the package name string or module.exports directly.
createPreset
const { createPreset } = require('babel-preset-atomic')
import { createPreset } from 'babel-preset-atomic'
ESM imports may work in Node 14+ but CJS is safer. The createPreset function is available since v4.4.0 for advanced configuration.

Shows how to configure the preset with Electron 11 target, TypeScript and React support, then compile a file.

// babel.config.js module.exports = { presets: [ ['babel-preset-atomic', { targets: { electron: '11' }, typescript: true, react: true }] ] }; // Then create an index.js with modern JS const greet = (name: string) => `Hello, ${name}!`; console.log(greet('World')); // Run: npx babel index.js --out-file index.bundle.js
Debug
Known issues
breakingv5.0.0 changed default Electron target to 11. Projects targeting older Electron versions must specify targets option explicitly.
fix
Add { targets: { electron: '9' } } to preset options for Electron 9 compatibility.
affects: >=5.0.0
breakingv4.0.0 dropped automatic Electron 5 targeting. Must provide targets option for Electron 5.
fix
Add { targets: { electron: '5' } } to preset options for Electron 5.
affects: >=4.0.0
deprecatedIncluding @babel/core as a dependency was deprecated after v4.3.0. Now it is a peer dependency.
fix
Install @babel/core as a devDependency: npm install --save-dev @babel/core
affects: <=4.3.0
gotchaThe preset does not export a default but uses module.exports. CommonJS require('babel-preset-atomic') returns an object, not a function. Direct import may fail.
fix
Use require('babel-preset-atomic') as a string in Babel config or use module.exports = require('babel-preset-atomic') if you need to modify.
affects: >=1.0.0
deprecatedTypeScript support from v4.4.0 uses @babel/preset-typescript. Previous versions used a custom transformer which may have different behavior.
fix
No action needed, but review TypeScript-specific options (e.g., isTSX, jsxPragma).
affects: >=4.4.0
Errors
Common errors & fixes
Error: Cannot find module '@babel/core'
Missing peer dependency @babel/core
fix
npm install --save-dev @babel/core
Error: Preset [object Object] is invalid. Expected a string or an array of [presetName, options]
Used import or incorrect module.exports pattern in Babel config
fix
Replace import with module.exports = { presets: ['babel-preset-atomic'] } or require('babel-preset-atomic') as the preset name.
Error: Unknown option: .targets. Check that it is correct
Preset options are incorrectly placed or typo in targets
fix
Verify targets is an object: { targets: { electron: '11' } }
Error: Requires Babel ">=7" but was loaded with "6.x"
Incompatible Babel version (6.x) installed
fix
Upgrade to Babel 7: npm install --save-dev @babel/core@^7
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
@babel/clioptionalPeer dependency required for Babel CLI usage
@babel/corerequiredPeer dependency required for Babel core functionality
Agent activity
4 hits · last 30 days
node
4
Resources
babel-preset-atomic — npm install babel-preset-atomic · libregistry