2 ms·
> Imagine being able to download just one build tool that by > default allows you to write something like > ‘jsc /some/js/dir -o /some/build/dir –enabl
by substack 11y ago
> Imagine being able to download just one build tool that by
> default allows you to write something like
> ‘jsc /some/js/dir -o /some/build/dir –enable-jsx’
$ npm install --save browserify babelify babel-preset-es2015 babel-preset-react
$ browserify -t [ babelify --presets [ es2015 react ] ] \
main.js -o public/bundle.js
To incrementally recompile when a file changes: `npm install --save watchify` and replace `browserify` with `watchify` above.
There are sets of tools that compose well and are easy to set up. I think developers hear about all these new techniques and think they need all of them, but it's much more important to know what you don't need and how to incrementally add pieces in small steps only when you need them and not before.