Skip to content

Instantly share code, notes, and snippets.

@sapegin
Created July 27, 2012 06:42
Show Gist options
  • Select an option

  • Save sapegin/3186513 to your computer and use it in GitHub Desktop.

Select an option

Save sapegin/3186513 to your computer and use it in GitHub Desktop.
Gruntfile for Wordpress theme
/**
How to build this project?
1. Install Grunt:
npm install grunt -g
mkdir node_modules
npm install grunt-stylus
2. Build:
grunt
*/
/*global module:false*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
meta: {
banner: "/*! Author: Artem Sapegin, http://sapegin.me, <%= grunt.template.today('yyyy') %> */"
},
lint: {
files: [
'grunt.js',
'js/*.js',
'js/mylibs/**/*.js'
]
},
concat: {
dist: {
src: [
'js/libs/jquery.mousewheel.js',
'js/mylibs/jquery.contentscroller.js',
'js/utils.js',
'js/main.js'
],
dest: 'build/scripts.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'build/scripts.min.js'
}
},
stylus: {
compile: {
files: {
'style.css': 'styles/index.styl'
},
options: {
'compress': true,
'include css': true,
'paths': ['styles']
}
}
},
watch: {
files: 'styles/**',
tasks: 'stylus'
},
jshint: {
options: {
browser: true,
white: false,
smarttabs: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
undef: true,
jquery: true
},
globals: {
Modernizr: true,
jQuery: true
}
},
uglify: {}
});
grunt.loadNpmTasks('grunt-stylus');
// Default task.
grunt.registerTask('default', 'lint stylus concat min');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment