Skip to content

Instantly share code, notes, and snippets.

@ebinnion
Created April 16, 2014 19:55
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ebinnion/10926420 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
sourceComments: 'map',
includePaths: require('node-bourbon').includePaths,
},
files: {
'css/style.css' : 'lib/scss/style.scss'
}
}
},
cssmin: {
css:{
// src: 'css/style.css',
// dest: 'css/style.min.css'
expand: true,
cwd: 'css/',
src: ['*.css', '!*.min.css'],
dest: 'css/',
ext: '.min.css'
}
},
autoprefixer: {
options: {
// Task-specific options go here.
},
single_file: {
src: 'css/style.css',
dest: 'css/style-prefix.css'
},
},
jshint: {
beforeconcat: ['lib/js/*.js']
},
concat: {
dist: {
src: [
'lib/js/plugins/*',
'lib/js/foundation.min.js',
'lib/js/main.js',
],
dest: 'js/production.js'
}
},
uglify: {
my_target: {
options: {
sourceMap: true,
sourceMapName: 'js/sourcemap.map'
},
files: {
'js/production.min.js': ['js/production.js']
}
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: ['lib/js/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
}
},
css: {
files: ['lib/scss/*.scss'],
tasks: ['sass', 'cssmin'],
options: {
spawn: false,
}
},
php: {
files: ['*.php'],
options: {
spawn: false
}
},
},
connect: {
server: {
options: {
port: 8000,
base: './'
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-devtools');
grunt.loadNpmTasks('grunt-autoprefixer');
// grunt.loadNpmTasks('grunt-uncss');
grunt.registerTask('default', ['watch']);
grunt.registerTask('prefix', ['autoprefixer', 'cssmin']);
};
{
"name": "CW",
"version": "1.0.0",
"private": true,
"dependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-watch": "latest",
"grunt-contrib-concat": "latest",
"grunt-contrib-less": "latest",
"node-bourbon": "~1.0.0",
"grunt-devtools": "latest"
},
"devDependencies": {
"grunt-contrib-sass": "~0.6.0",
"grunt-contrib-imagemin": "~0.4.0",
"grunt-contrib-compass": "~0.7.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-uncss": "~0.3.3",
"grunt-sass": "~0.12.1",
"grunt-concat-sourcemap": "~0.4.1",
"grunt-autoprefixer": "~0.7.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment