| module.exports = function(grunt) { |
| // Initializing the configuration object |
| grunt.initConfig({ |
| // Task configuration |
| less: { |
| development: { |
| options: { |
| compress: true, |
| // minifying the result |
| }, |
| files: { |
| // compiling styles.less into styles.css |
| "./assets/public/stylesheets/donorlist.min.css": "./assets/src/stylesheets/donorlist.less", |
| "./assets/public/stylesheets/improve.min.css": "./assets/src/stylesheets/improve.less", |
| "./assets/public/stylesheets/credit.min.css": "./assets/src/stylesheets/credit.less", |
| "./assets/public/stylesheets/support.min.css": "./assets/src/stylesheets/support.less" |
| } |
| } |
| }, |
| uglify: { |
| options: { |
| mangle: true |
| // Use if you want the names of your functions and variables |
| // unchanged. |
| }, |
| js_files: { |
| files: { |
| './assets/public/javascript/scripts.min.js': './assets/src/javascript/scripts.js' |
| } |
| }, |
| }, |
| watch: { |
| js_files: { |
| files: [ |
| './assets/src/javascript/scripts.js'], |
| tasks: ['uglify:js_files'] |
| }, |
| less: { |
| files: ['./assets/src/stylesheets/*.less', './assets/src/stylesheets/**/*.less'], |
| tasks: ['less'], |
| options: { |
| livereload: false, |
| // reloads the browser |
| } |
| }, |
| } |
| }); |
| // Plugin loading |
| grunt.loadNpmTasks('grunt-contrib-watch'); |
| grunt.loadNpmTasks('grunt-contrib-less'); |
| grunt.loadNpmTasks('grunt-contrib-uglify'); |
| // Task definition |
| grunt.registerTask('default', ['watch']); |
| }; |