Minimal example setup for ES6 with the Babel transpiler and a simple grunt "dev" task for watch, connect and livereload.
All you need is node
with npm
and grunt-cli
.
# install the setup depedencies
npm install
# install grunt-cli globally (if you don't have it installed)
npm install -g grunt-cli
# check the grunt default task...
grunt
# ... and the dev task
grunt dev
- Just Grunt+Babel
- Manual transpilation for
src/app.js
with thegrunt
default task - Add some ES6 code to
src/app.js
and transpile it
- Manual transpilation for
- Dev-Task with watch and connect - Diff - Just the changes
- Run
grunt dev
(http://localhost:9001 should open automatically) - Change some code in
src/app.js
orindex.html
- Run
- Module loader setup with SystemJS - Diff - Just the changes
- Re-run
grunt dev
- Add some modules like
src/my-module.js
- Add a class and export it
export {MyClass}; class MyClass {};
- Import it in
src/app.js
withimport {MyClass} from './my-module.js'; var o = new MyClass();
- And now with wildcard imports
import * as myModule from './my-module.js'; var o = new myModule.MyClass();
- Re-run