Skip to content

Instantly share code, notes, and snippets.

@matthewbeta
Created November 13, 2013 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewbeta/7457897 to your computer and use it in GitHub Desktop.
Save matthewbeta/7457897 to your computer and use it in GitHub Desktop.
Barebones Gruntfile for Ember.JS. It concats your files, it processes your handlebars and smashes that suckah into (3) tiny files.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// uglify
uglify: {
app: {
files: {
'app/app.min.js': 'app/app.js'
}
},
lib: {
files: {
'app/libs.min.js': 'app/libs.js'
}
},
templates: {
files: {
'app/templates.min.js': 'app/templates.js'
}
}
},
concat: {
options: {
separator: ';',
},
app: {
files: {
'app/libs.js':
[
'lib/jquery-1.9.1.js',
'lib/handlebars-1.0.0.js',
'lib/ember-1.1.2.js',
'lib/ember-states.js',
'lib/ember-data.js',
'lib/moment.min.js',
'lib/localstorage_adapter.js'
],
'app/app.js':
[
'app.js',
'store.js',
'router.js',
'routes/**/*.js',
'models/**/*.js',
'views/**/*.js',
'controllers/**/*.js',
'components/**/*.js',
'helpers/**/*.js',
]
}
},
},
emberTemplates: {
compile: {
options: {
templateBasePath: "templates/"
},
files: {
"app/templates.js": "templates/**/*.hbs"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-ember-templates');
grunt.registerTask('default', ['concat', 'emberTemplates', 'uglify' ]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment