Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(grunt) {
- // 1. All configuration goes here
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
- concat: {
- // 2. Configuration for concatinating files goes here.
- dist: {
- src: [
- 'library/js/libs/*.js', // All JS in the libs folder
- 'library/js/custom-scripts.js', // Custom Scripts
- ],
- dest: 'dist/js/production.js'
- }
- },
- uglify: {
- build: {
- src: 'dist/js/production.js',
- dest: 'dist/js/production.min.js'
- }
- },
- imagemin: {
- png: {
- options: {
- optimizationLevel: 7
- },
- files: [
- {
- expand: true,
- cwd: 'library/img/',
- src: ['**/*.png'],
- dest: 'dist/img',
- ext: '.png'
- }
- ]
- },
- jpg: {
- options: {
- progressive: true
- },
- files: [
- {
- expand: true,
- cwd: 'library/img/',
- src: ['**/*.jpg'],
- dest: 'dist/img',
- ext: '.jpg'
- }
- ]
- }
- },
- less: {
- development: {
- options: {
- compress: true,
- yuicompress: false,
- cleancss: true,
- paths: ["less"]
- },
- files: {
- "dist/css/production.css": "library/less/global.less"
- }
- }
- },
- cssmin: {
- add_banner: {
- options: {
- banner: '/* Minified CSS File*/'
- },
- files: {
- "dist/css/production.min.css": "dist/css/production.css"
- }
- }
- },
- autoprefixer: {
- options: {
- // Task-specific options go here.
- },
- your_target: {
- src: 'dist/css/production.min.css'
- }
- },
- watch: {
- options: {
- livereload: true
- },
- src: {
- files: ['*.php', 'library/functions/*.php']
- },
- scripts: {
- files: ['library/js/libs/*.js', 'library/js/*.js', 'includes/*.php', 'includes/loops/*.php'],
- tasks: ['concat', 'uglify'],
- options: {
- spawn: false
- }
- },
- css: {
- files: ['library/less/*.less', 'library/less/bootstrap/*less', 'library/less/imports/*less'],
- tasks: ['less','cssmin', 'autoprefixer'],
- options: {
- spawn: false,
- debounceDelay: 250
- }
- }
- }
- });
- // 3. Where we tell Grunt we plan to use this plug-in.
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-imagemin');
- grunt.loadNpmTasks('grunt-contrib-less');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-cssmin');
- grunt.loadNpmTasks('grunt-autoprefixer');
- // 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
- grunt.registerTask('default', ['watch', 'concat', 'uglify', 'imagemin', 'autoprefixer']);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement