Skip to content

Instantly share code, notes, and snippets.

@cfoellmann
Created March 17, 2014 18:12
Show Gist options
  • Select an option

  • Save cfoellmann/9605001 to your computer and use it in GitHub Desktop.

Select an option

Save cfoellmann/9605001 to your computer and use it in GitHub Desktop.
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
files: {
src: 'assets/js/uber-media.js',
dest: 'assets/js/',
expand: true,
flatten: true,
ext: '.min.js'
}
},
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'assets/css/uber-media.css' : 'assets/css/scss/uber-media.scss'
}
},
dist2: {
options: {
style: 'compressed'
},
files: {
'assets/css/uber-media.min.css' : 'assets/css/scss/uber-media.scss'
}
}
},
makepot: {
options: {
exclude: [ 'node_modules/**' ],
mainFile: 'uber-media.php',
potFilename: 'media-manager-plus.pot',
type: 'wp-plugin'
}
},
watch: {
js: {
files: 'assets/js/uber-media.js',
tasks: [ 'uglify' ]
},
sass: {
files: 'assets/css/scss/*.scss',
tasks: ['sass']
}
}
});
// load plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-wp-i18n');
// register at least this one task
grunt.registerTask('default', [ 'watch' ]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment