1 | <h3 align="center">
|
2 | pob-babel
|
3 | </h3>
|
4 |
|
5 | <p align="center">
|
6 | Build and watch with babel and typescript
|
7 | </p>
|
8 |
|
9 | <p align="center">
|
10 | <a href="https://npmjs.org/package/pob-babel"><img src="https://img.shields.io/npm/v/pob-babel.svg?style=flat-square"></a>
|
11 | <a href="https://david-dm.org/christophehurpeau/pob?path=packages/pob-babel"><img src="https://david-dm.org/christophehurpeau/pob.svg?path=packages/pob-babel?style=flat-square"></a>
|
12 | </p>
|
13 |
|
14 | ### What it does
|
15 |
|
16 | - Transpiles js and jsx files for specific envs (pre-node6, node6, webpack 2, modern browsers webpack 2)
|
17 | - Transform yml files to json (for faster load)
|
18 | - Allow you to register plugins to transform more files by extension
|
19 | - `watch` returns an EventEmitter to allow you to restart your server if needed.
|
20 |
|
21 | ### Install
|
22 |
|
23 | ```sh
|
24 | npm install --save-dev pob-babel
|
25 | ```
|
26 |
|
27 | Also install babel plugins and presets
|
28 |
|
29 | Create .pob.json
|
30 |
|
31 | ```json
|
32 | {
|
33 | "react": false,
|
34 | "envs": ["node6", "webpack", "webpack-modern-browsers"],
|
35 | }
|
36 | ```
|
37 |
|
38 | ### How to use
|
39 |
|
40 | #### Direct use
|
41 |
|
42 | ```
|
43 | node_modules/.bin/pob-build
|
44 | node_modules/.bin/pob-watch
|
45 | ```
|
46 |
|
47 | #### With npm scripts `npm run build`
|
48 |
|
49 | Edit your package.json:
|
50 |
|
51 | ```json
|
52 | {
|
53 | "scripts": {
|
54 | "build": "pob-build",
|
55 | "watch": "pob-watch"
|
56 | }
|
57 | }
|
58 | ```
|