Registry / devops / babel-preset-github

babel-preset-github

JSON →
library3.2.1jsnpmunverified

GitHub.com's official Babel preset for transpiling JavaScript. Current version 3.2.1 (released 2019, last updated 2019-08-08). Based on `@babel/preset-env` with curated set of plugins used by GitHub.com, including support for ES2018+ and some non-standard features. Targets GitHub's browser support matrix by default, but supports custom browserlist targets. Limited release cadence and narrow scope (primarily for internal GitHub usage). Minimal community adoption outside GitHub.

npm install babel-preset-github
INSTALL
IMPORT
SIG · BABEL-PRESET-GITHU
B
babel-preset-github
devopsjavascriptv3.2.1
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-github')
import preset from 'babel-preset-github'
Babel presets are CommonJS; use require() in .babelrc.js or webpack config. ESM import may work in some environments but is not recommended.
preset
"presets": ["github"]
"presets": ["babel-preset-github"]
In .babelrc, use short name 'github'. Babel resolves 'babel-preset-' prefix automatically.
targets
"presets": [["github", {"targets": {"browsers": ["last 1 version"]}}]]
"presets": [["github", {"browsers": ["last 1 version"]}]]
Browser targets must be nested under 'targets.browsers' key, consistent with @babel/preset-env.

Shows how to configure babel-preset-github in .babelrc file with optional browserslist customization.

// Install: npm install --save-dev babel-preset-github @babel/core // .babelrc { "presets": ["github"] } // Or with custom browsers: { "presets": [ ["github", { "targets": { "browsers": ["last 2 versions", "not ie <= 11"] } }] ] }
Debug
Known issues
deprecatedbabel-preset-github is no longer actively maintained by GitHub; consider using @babel/preset-env directly with appropriate targets.
fix
Switch to @babel/preset-env with 'github' browserlist (e.g. 'last 1 chrome version, last 1 firefox version, last 1 safari version')
affects: >=3.0.0
gotchaThe 'targets' option expects { browsers: array } format, not top-level array.
fix
Use "presets": [["github", {"targets": {"browsers": ["last 1 version"]}}]]
affects: >=3.0.0
gotchaDefault browser targets are outdated and may not match GitHub's current browser support.
fix
Specify explicit browserslist targets that match your project's requirements.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-github'
Missing package installation or incorrect module resolution
fix
Run npm install --save-dev babel-preset-github @babel/core and ensure node_modules is intact.
Error: [BABEL] Unknown presets: github
Preset name not resolved; Babel cannot find 'babel-preset-github' in node_modules
fix
Ensure the package is installed and .babelrc uses short name 'github' (not 'babel-preset-github').
Error: Plugin/Preset files are not allowed to export anything but a function
Using an ES module import for babel-preset-github in a .babelrc.js file that expects CommonJS
fix
Use require() instead of import: const preset = require('babel-preset-github')
Upgrade
Version history
3.2.1latest on npm
Audit
Dependencies
@babel/coreoptionalRequired peer dependency for any Babel preset
@babel/preset-envrequiredCore underlying preset used for transpilation
@babel/plugin-proposal-class-propertiesrequiredTransforms static class properties
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-preset-github — npm install babel-preset-github · libregistry