Created
July 10, 2012 22:25
-
-
Save buzzedword/3086592 to your computer and use it in GitHub Desktop.
Grunt.js for grunt-recess
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-recess'); | |
var recessOptions = function(bool) { | |
bool = ((typeof bool === 'undefined')? false : bool); | |
var config = { | |
compile: true, | |
compress: bool, | |
noIDs: false, | |
noJSPrefix: false, | |
noOverqualifying: false, | |
noUnderscores: false, | |
noUniversalSelectors: false, | |
prefixWhitespace: false, | |
strictPropertyOrder: false, | |
zeroUnits: false | |
} | |
return config; | |
}, | |
frontendPaths = { | |
resources: 'src/Project/Bundle/FrontendBundle/Resources' | |
}; | |
// Project configuration. | |
grunt.initConfig({ | |
recess: { | |
frontendMaxified: { | |
src: [frontendPaths.resources + '/less/base.less'], | |
dest: frontendPaths.resources + '/css/base.css', | |
options: recessOptions(false) | |
}, | |
frontendMinified: { | |
src: [frontendPaths.resources + '/less/base.less'], | |
dest: frontendPaths.resources + '/css/base.min.css', | |
options: recessOptions(true) | |
} | |
}, | |
watch: { | |
frontend: { | |
files: [frontendPaths.resources + '/less/*.less'], | |
tasks: 'recess' | |
} | |
}, | |
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, | |
Backbone: true, | |
_: true, | |
console: true | |
} | |
}, | |
uglify: {} | |
}); | |
// Default task. | |
grunt.registerTask('default', 'recess'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment