Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- It's easy! There are only 2 steps:
- 1. Install required packages with NPM: `npm install browserify babelify`
- 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):
- ```json
- {
- "scripts": {
- "build-js": "browserify -t babelify main.js > bundle.js"
- }
- }
- ```
- 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*).
- Have fun writing JavaScript of tomorrow!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement