Installation

https://babeljs.io/

Typecript vs Babel

Typescript

Babel

Language- Typed superset of js

Not a language

Also can be used as transpiler

Transpiler

Less spec complaint

Spec complaint

Prerequisites

  • Node JS

Quick Tip

To see all global installed node packages...

npm ls -global --depth 0

Install Babel

// global install
npm i babel-cli -g
babel --version

// local install
npm i babel-cli -D
node_modules/.bin/babel --version
npm i babel-preset-es2015 -D

Trnspilation form terminal

Stage 0 ( all in one babel package )

Move plugin configuration to .babelrc

Quick Tip

npm run demo

Note

Fully qualified path not required, npm knows node_modules/.bin/babel

Babel with Npm Scripts

Babel with gulp

Babel with webpack

Babel with browserify

Last updated

Was this helpful?