Created
November 13, 2013 22:46
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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