https://github.com/simonespa/plain-babel
A simple example of plain babel configuration
https://github.com/simonespa/plain-babel
babel babel-polyfill es6 polyfill
Last synced: about 2 months ago
JSON representation
A simple example of plain babel configuration
- Host: GitHub
- URL: https://github.com/simonespa/plain-babel
- Owner: simonespa
- Created: 2017-09-12T17:33:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T17:34:22.000Z (almost 9 years ago)
- Last Synced: 2025-04-11T18:09:42.898Z (about 1 year ago)
- Topics: babel, babel-polyfill, es6, polyfill
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# plain-babel
This exercise is to understand how to use plain babel and configure it.
## Objective
The objective of this repo is to use plain babel in order to learn how static transpiling and runtime polyfill works.
## Related links
* https://babeljs.io/
* https://babeljs.io/docs/usage/polyfill
## Get started
Feel free to play with `es6.js` and add some more [ES6 syntax](https://babeljs.io/learn-es2015/). Assuming you already run `yarn install`, we can now transpile it by running `yarn transpile`. This command will generate `transpiled-es5.js`. Now you can run the final ES5 code with `yarn start`.
Notice that `es6.js` uses Promise, and since babel transpiling is static, you need to have a polyfill at runtime that provide the Promise API.