by Touche · 11y ago · 0 comments
Ugh, I find this to be excruciating. So you read about some new cool technology on HTML5Rocks and you want to play around with it. You have to:
* npm init
* npm install babel --save
* npm install browserify/webpack/greatest-thing-ever-of-the-week --save
* npm install gulp/grunt/broccoli/other-task-runner --save
* vi (gulp/grunt/broc/other)file.js
* Write some code to build your application.
* vi myapp.js (write some code to do your thing)
* > (gulp/grunt/broc) build
* Write an html file that includes your bundled es5.
* Open it in the browser. Yay! Cool I can debug now... wait a second I made a mistake.
* vi myapp.js and fix mistake.
* > (gulp/grunt/broc) build
* Oops I made another mistake. Better set up a watch-mode so I don't have to keep running build.
* npm install some-watch-thing --save
* vi (gulp/grunt/broc/other)file.js
* Add your watch code
* > (gulp/grunt/broc) watch
* Yay I can finally just fucking code now.
If you're just playing with code, here's a simpler workflow:
* npm install babel
* write file.js
* run `babel-node file.js`
Similar to your example, the only extra step here is installing babel. If it's excruciating, install it globally and save yourself forever.
Regardless, vi index.html is much simpler.
So, IMHO, you may as well stick the new shiny in before/after JSHint while you're in the (gulp|grunt|broc)file.
It's not necessary, I'm just wanting to hack at some new API I read about on the web. Assuming I need to set up a test harness, CI, and linting is putting the cart well-before the horse.
Learn your tools: https://babeljs.io/docs/usage/require/
* git clone 'boilerplate'
* npm i
* gulp watch
* Yay I can finally just fucking code now.