Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. It's easy! There are only 2 steps:
  2.  
  3. 1. Install required packages with NPM: `npm install browserify babelify`
  4. 2. Create *package.json* with the following content (for example, here *main.js* file is source file and *bundle.js* is output file. Also note we are applying transformer to browserify command):
  5.  
  6. ```json
  7. {
  8. "scripts": {
  9. "build-js": "browserify -t babelify main.js > bundle.js"
  10. }
  11. }
  12. ```
  13.  
  14. Thats it! Now whenever you feel to build up your ES6 code (*main.js*), just fire `npm run build`. If you are wondering why building via NPM: it allows you to call commands that are installed on project level (so you don't have to pollute global *node_modules*).
  15.  
  16. Have fun writing JavaScript of tomorrow!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement