Skip to content

Instantly share code, notes, and snippets.

@shapeshifta78
Forked from pamelafox/grunt.js
Created August 3, 2012 14:48
Show Gist options
  • Save shapeshifta78/3248306 to your computer and use it in GitHub Desktop.
Save shapeshifta78/3248306 to your computer and use it in GitHub Desktop.
Grunt for a CSS/JS WebApp
/*global module:false*/
module.exports = function(grunt) {
var CSS_DIR = 'src/css/';
var JS_DIR = 'src/js/';
var BUILD_DIR = '../build/';
// Project configuration.
grunt.initConfig({
lint: {
files: [JS_DIR + 'app/**/*.js']
},
concat: {
css: {
src: [CSS_DIR + 'libs/*.css', CSS_DIR + 'app/*.css'],
dest: BUILD_DIR + 'css/editor.css'
},
js: {
src: [JS_DIR + 'libs/bootstrap.js', JS_DIR + 'libs/closure-all.js', JS_DIR + 'app/*.js'],
dest: BUILD_DIR + 'js/editor.js'
},
},
min: {
js: {
src: '<config:concat.js.dest>',
dest: BUILD_DIR + 'js/editor-min.js'
}
},
cssmin: {
css: {
src: '<config:concat.css.dest>',
dest: BUILD_DIR + 'css/editor-min.css'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {'jQuery': true}
},
uglify: {}
});
grunt.loadNpmTasks('grunt-css');
// Default task.
grunt.registerTask('default', 'concat min cssmin');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment