| 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 |
| "./public/css/styles.min.css": "./src/less/styles.less", |
| } |
| } |
| }, |
| concat: { |
| options: { |
| separator: ';', |
| }, |
| js_frontend: { |
| src: ['./src/js/validation.jquery.js','./src/js/subscriptions_tab.js'], |
| dest: './public/js/script.min.js', |
| }, |
| }, |
| uglify: { |
| options: { |
| mangle: false |
| // Use if you want the names of your functions and variables |
| // unchanged. |
| }, |
| frontend: { |
| files: { |
| './public/js/script.min.js': './public/js/script.min.js', |
| } |
| }, |
| }, |
| watch: { |
| js_frontend: { |
| files: [ |
| // watched files |
| './src/js/*.js'], |
| // tasks to run |
| tasks: ['concat:js_frontend', 'uglify:frontend'], |
| }, |
| less: { |
| files: ['./src/less/*.less', './src/less/**/*.less'], |
| // watched files |
| tasks: ['less'], |
| // tasks to run |
| }, |
| } |
| }); |
| // Plugin loading |
| grunt.loadNpmTasks('grunt-contrib-concat'); |
| grunt.loadNpmTasks('grunt-contrib-watch'); |
| grunt.loadNpmTasks('grunt-contrib-less'); |
| grunt.loadNpmTasks('grunt-contrib-uglify'); |
| grunt.loadNpmTasks('grunt-contrib-copy'); |
| // Task definition |
| grunt.registerTask('default', ['watch']); |
| }; |