Registry / web-framework / babel-preset-angular

babel-preset-angular

JSON →
library6.0.15jsnpmunverified

Babel preset for all Angular plugins. Current stable version is 6.0.15. This package bundles multiple Babel transforms needed for Angular applications. It is designed for older Angular (1.x) projects; for Angular 2+ (now Angular), use the Angular compiler instead. The preset is not actively maintained and relies on legacy Babel 6. Release cadence is low; no recent updates. Key differentiator: simplifies configuration by grouping Angular-specific Babel plugins.

npm install babel-preset-angular
INSTALL
IMPORT
SIG · BABEL-PRESET-ANGUL
B
babel-preset-angular
web-frameworkjavascriptv6.0.15
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 = { presets: ['angular'] }
require('babel-preset-angular')
Used via Babel's .babelrc or programmatic API, not directly imported in code.
preset
{ "presets": ["angular"] }
{ "presets": ["babel-preset-angular"] }
Babel resolves preset names without the 'babel-preset-' prefix.
plugins
require('babel-core').transform('code', { presets: [require('babel-preset-angular')] })
import preset from 'babel-preset-angular'
ESM import may not work; use CommonJS require with babel-core.

Shows how to set up .babelrc to use babel-preset-angular and compile a file via CLI.

// Ensure you have babel-cli and babel-preset-angular installed // npm install --save-dev babel-cli babel-preset-angular // Create .babelrc file with: { "presets": ["angular"] } // Then run: // babel script.js --out-file script-compiled.js
Debug
Known issues
deprecatedbabel-preset-angular is not actively maintained and uses Babel 6, which is end-of-life.
fix
Migrate to a modern Angular build system (e.g., Angular CLI with @angular/compiler-cli).
affects: >=6.0
breakingThe preset includes babel-preset-es2015 which doesn't support modern JavaScript features like async/await beyond ES2015.
fix
Add additional presets like babel-preset-stage-2 or use babel-preset-env.
affects: >=6.0
gotchaUsing the full preset name 'babel-preset-angular' in .babelrc presets array does not work; Babel expects short name 'angular'.
fix
Use 'angular' (omitting 'babel-preset-') in the presets array.
affects: >=6.0
Errors
Common errors & fixes
require is not defined
Using ESM import syntax with babel-core in a CommonJS environment.
fix
Use require instead of import: const babel = require('babel-core');
Error: Cannot find module 'babel-preset-angular'
Missing npm install or incorrect require path.
fix
Run 'npm install --save-dev babel-preset-angular' and ensure node_modules is present.
Unknown plugin 'angular' specified in
Using an outdated Babel version that doesn't support unnamed plugins.
fix
Use Babel 6 or check preset naming.
Upgrade
Version history
6.0.15latest on npm
Audit
Dependencies
babel-corerequiredRequired for Babel transformation
babel-preset-es2015requiredIncluded in the preset for ES2015 support
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
babel-preset-angular — npm install babel-preset-angular · libregistry