Notice: This project is no longer maintained as ember-cli (recommended) and Gulp ecosystems have matured.
Launch your next Ember project with modern conveniences that no front-end developer should be without. Grumber is a lean and simple boilerplate for your next front-end JavaScript project based on Ember, Grunt, and HTML5 Boilerplate.
- simple and flexible build process using Grunt
- watches source files for changes, rebuilds and activates LiveReload in browser
- concatenates JS files and generates a Source Map
- applies your coding standards using jshint
- pre-compiles Handlebars templates
- production JS minification with UglifyJS
- built-in web server for prototyping until your server/API is ready
I am leaving out extras like a scaffolding tool, module loader, CSS framework/compiler, etc. since your projects and tastes are likely to be different than my own. My hope is that you can quickly integrate anything you need. This is meant to be lightweight. If you are looking for something heavier and more opinionated, check out Ember App Kit.
First, ensure all dependencies are installed and up-to-date:
From this project folder run
[sudo] npm install
This will install the development dependencies listed in the package.json
file
and store them in locally in node_modules
. These modules are invoked when
running the associated Grunt tasks.
Once all the dependencies are installed you should be ready to put Grunt to work...
From the project folder run
grunt
This starts the default task defined in tasks/default.js
. This will build a
development version of your application, start a server on port 8500 (by default),
and start watching the source files for changes.
Now you can open localhost:8500
in a browser to load the Ember application.
If you intend to automate your builds (via continuous integration) or just want
to build without the watch
and connect:dev
(server) tasks use
grunt dev
The dev
task (also run from the default
task) cleans the target directories,
compiles the Handlebars templates, and concatenates the JS source files to a single
file for the browser, and generates the Source Map.
Grunt also allows you to run multiple tasks consecutively so running grunt dev watch
will
build the project and then watch for changes.
Building the application for final production use is as simple as running
grunt dist
This task is setup to lint the application code, clean the target directories, pre-compile the templates, concatenate, and minify the JS.
Thanks to Trek Glowacki for his ember-todos project which helped me learn Grunt when it wasn't so easy.