Created
October 28, 2014 05:09
-
-
Save bmuenzenmeyer/9dd62b9def7c8e5fc55c to your computer and use it in GitHub Desktop.
A simple gruntfile to extract Wordpress theme and plugin assets for concatenation and minification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt){ | |
grunt.initConfig({ | |
sass: { | |
dist: { | |
options: { | |
style: 'compressed' | |
}, | |
files: { | |
'../wp-content/themes/SiteName/style.css': 'scss/main.scss' | |
} | |
} | |
}, | |
concat: { | |
options: { | |
seperator: ';', | |
}, | |
concatenated: { | |
files: { | |
'dist/site.js' : [ | |
'../wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js', | |
'../wp-content/plugins/contact-form-7/includes/js/scripts.js', | |
'../wp-content/themes/SiteName/js/jquery-migrate.min.js', | |
'../wp-content/themes/SiteName/js/site.js' | |
] | |
} | |
} | |
}, | |
uglify: { | |
min: { | |
files: { 'dist/site.min.js': 'dist/site.js' } | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
grunt.registerTask('default', ['sass', 'concat', 'uglify']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment