module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), bower: { js: { dest: 'web/js/vendor', options: { cleanTargetDir: true, checkExistence: true, debugging: false, paths: { bowerDirectory: 'vendor/bower', bowerrc: '.bowerrc', bowerJson: 'bower.json' } } } }, copy: { dist: { files: [ { expand: true, cwd: 'vendor/bower/uikit/fonts', src: ['*'], dest: 'web/fonts', filter: 'isFile' } ] } }, less: { build: { options: { plugins: [new (require('less-plugin-autoprefix'))({browsers: ["last 3 versions"]}),], paths: [ 'vendor/bower/uikit/less', 'src/Sikofitt/less' ], strictImports: true, compress: true }, files: { 'web/css/resume.min.css': 'src/Sikofitt/less/resume.less' } } }, watch: { configFiles: { files: ['Gruntfile.js'], options: { reload: true } }, dev: { files: ['src/Sikofitt/less/*', 'src/Sikofitt/js/*'], tasks: ['dev'] } }, uglify: { options: { mangle: true, compress: { drop_console: true }, banner: '/*! Resume.PHP - v<%= pkg.version %> - ' + '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss tt") %> */', nameCache: '.tmp/grunt-uglify-cache.json' }, dist: { files: {'web/js/resume.min.js': ['src/Sikofitt/js/resume.js']} } } }); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('main-bower-files'); grunt.loadNpmTasks('grunt-phpunit'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask('dist', ['bower', 'less', 'uglify', 'copy']); grunt.registerTask('dev', ['less', 'uglify']) grunt.registerTask('default', 'dist'); };