UNPKG

833 BMarkdownView Raw
1# pob-babel
2
3Build and watch with babel
4
5### What it does
6
7- Transpiles js and jsx files for specific envs (pre-node6, node6, webpack 2, modern browsers webpack 2)
8- Transform yml files to json (for faster load)
9- Allow you to register plugins to transform more files by extension
10- `watch` returns an EventEmitter to allow you to restart your server if needed.
11
12### Install
13
14```sh
15npm install --save-dev pob-babel
16```
17
18Also install babel plugins and presets
19
20Create .pob.json
21
22```json
23{
24 "react": false,
25 "envs": ["node6", "webpack", "webpack-modern-browsers"],
26}
27```
28
29### How to use
30
31#### Direct use
32
33```
34node_modules/.bin/pob-build
35node_modules/.bin/pob-watch
36```
37
38#### With npm scripts `npm run build`
39
40Edit your package.json:
41
42```json
43{
44 "scripts": {
45 "build": "pob-build",
46 "watch": "pob-watch"
47 }
48}
49
50```