Created
May 5, 2014 17:41
-
-
Save zetas/19b6f25cfd9b3c95c6f5 to your computer and use it in GitHub Desktop.
Yes, I finally made the plunge into grunt.
This file contains 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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' | |
}, | |
build: { | |
files: [ | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/main/static/main/js', | |
src: ['*.js'], | |
dest: '<%= pkg.localCWD %>/main/static/main/js/min/', | |
ext: '.min.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/papers/static/papers/js', | |
src: ['*.js'], | |
dest: '<%= pkg.localCWD %>/papers/static/papers/js/min/', | |
ext: '.min.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/account/static/account/js', | |
src: ['*.js'], | |
dest: '<%= pkg.localCWD %>/account/static/account/js/min/', | |
ext: '.min.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/classes/static/classes/js', | |
src: ['*.js'], | |
dest: '<%= pkg.localCWD %>/classes/static/classes/js/min/', | |
ext: '.min.js', | |
extDot: 'last' | |
} | |
] | |
} | |
}, | |
coffee: { | |
compile: { | |
files: [ | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/main/coffee', | |
src: ['*.coffee'], | |
dest: '<%= pkg.localCWD %>/main/static/main/js/', | |
ext: '.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/papers/coffee', | |
src: ['*.coffee'], | |
dest: '<%= pkg.localCWD %>/papers/static/papers/js/', | |
ext: '.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/account/coffee', | |
src: ['*.coffee'], | |
dest: '<%= pkg.localCWD %>/account/static/account/js/', | |
ext: '.js', | |
extDot: 'last' | |
}, | |
{ | |
expand: true, | |
cwd: '<%= pkg.localCWD %>/classes/coffee', | |
src: ['*.coffee'], | |
dest: '<%= pkg.localCWD %>/classes/static/classes/js/', | |
ext: '.js', | |
extDot: 'last' | |
} | |
] | |
} | |
}, | |
compass: { | |
main: { | |
options: { | |
sassDir: '<%= pkg.localCWD %>/main/design', | |
cssDir: '<%= pkg.localCWD %>/main/static/main/css', | |
noLineComments: true, | |
outputStyle: 'compressed' | |
} | |
}, | |
papers: { | |
options: { | |
sassDir: '<%= pkg.localCWD %>/papers/design', | |
cssDir: '<%= pkg.localCWD %>/papers/static/papers/css', | |
noLineComments: true, | |
outputStyle: 'compressed' | |
} | |
}, | |
account: { | |
options: { | |
sassDir: '<%= pkg.localCWD %>/account/design', | |
cssDir: '<%= pkg.localCWD %>/account/static/account/css', | |
noLineComments: true, | |
outputStyle: 'compressed' | |
} | |
}, | |
classes: { | |
options: { | |
sassDir: '<%= pkg.localCWD %>/classes/design', | |
cssDir: '<%= pkg.localCWD %>/classes/static/classes/css', | |
noLineComments: true, | |
outputStyle: 'compressed' | |
} | |
} | |
} | |
}); | |
// Load the plugin that provides the "uglify" task. | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-coffee'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
// Default task(s). | |
grunt.registerTask('default', ['coffee', 'uglify', 'compass']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment