Skip to content

Instantly share code, notes, and snippets.

@m0nkey
Created September 25, 2013 19:29
Show Gist options
  • Save m0nkey/6704791 to your computer and use it in GitHub Desktop.
Save m0nkey/6704791 to your computer and use it in GitHub Desktop.
LESS file watch and compile
module.exports = function (grunt) {
grunt.initConfig({
less: {
development: {
options: {
paths: ["media/web/common/premium/less"],
yuicompress: false
},
files: {
"media/web/common/premium/css/master.css": "media/web/common/premium/less/master.less",
"media/web/common/premium/css/master-responsive.css": "media/web/common/premium/less/master-responsive.less"
}
}
},
watch: {
// Watch files for changes and run the task
files: "media/web/common/premium/less/*",
tasks: ["less"]
},
jasmine: {
nokarma: {
src: 'media/web/common/javascript/cmg-utility.js',
options: {
//template: 'media/web/common/javascript/cmg-utility/test/fixture.html',
specs: 'media/web/common/javascript/cmg-utility/test/*.spec.js',
vendor: [
'media/web/common/javascript/jquery-1.7.1.min.js',
'media/web/common/javascript/cmg.js',
'media/web/common/javascript/underscore/build/underscore-min.js',
'media/web/common/javascript/cmg-utility/test/fixture.js'
]
}
}
},
karma: {
// Create your own suite with a path to your karma.conf file.
ads: {
configFile: 'media/mobile/common/javascript/medley_ads/test/karma.conf.js'
},
utility: {
configFile: 'media/web/common/javascript/cmg-utility/test/karma.conf.js'
},
// Global overrides. These settings override all conf files.
options: {
singleRun: true,
preprocessors: {'*.html': 'html2js'},
plugins: [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-html2js-preprocessor'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// Register your task here to be included in regression testing.
grunt.registerTask('nokarma', [
'jasmine'
]);
grunt.registerTask('default', [
'karma:ads',
'karma:utility'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment