Skip to content

Instantly share code, notes, and snippets.

@Bonemind
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save Bonemind/e72a6b7312ae76e68585 to your computer and use it in GitHub Desktop.

Select an option

Save Bonemind/e72a6b7312ae76e68585 to your computer and use it in GitHub Desktop.
A generic gruntfile for compiling webapps
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
concat: {
js: {
src: [
"models/**/*.js",
"collections/**/*.js",
"controllers/**/*.js",
"views/**/*.js",
],
dest: "build/app.js"
},
html: {
src: [
"main.html",
"templates/**/*.html",
"foot.html",
],
dest: "index.html",
},
},
watch: {
scripts: {
files: ['**/*.js', '**/*.html','!build/*.js', '!index.html'],
tasks: ['concat'],
},
},
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.registerTask("default", ["concat"]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment