Skip to content

Instantly share code, notes, and snippets.

@ivolivares
Forked from bradfrost/gist:10906886
Created June 23, 2014 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivolivares/071c3c268b358e8a5ebd to your computer and use it in GitHub Desktop.
Save ivolivares/071c3c268b358e8a5ebd to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'source/js/libs/*.js', // All JS in the libs folder
'source/js/init.js' // This specific file
],
dest: 'public/js/production.js'
}
},
uglify: {
build: {
src: 'public/js/production.js',
dest: 'public/js/production.min.js'
}
},
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'public/css/style.css': 'source/css/style.scss',
'public/styleguide/css/styleguide.css': 'public/styleguide/css/styleguide.scss',
'public/styleguide/css/styleguide-specific.css': 'public/styleguide/css/styleguide-specific.scss'
}
}
},
autoprefixer: {
single_file: {
src: 'public/css/style.css',
dest: 'public/css/style.css'
}
},
shell: {
patternlab: {
command: "php core/builder.php -gp"
}
},
watch: {
html: {
files: ['source/_patterns/**/*.mustache', 'source/_patterns/**/*.json', 'source/_data/*.json'],
tasks: ['shell:patternlab'],
options: {
livereload: true,
spawn: false
}
},
scripts: {
files: ['source/js/*.js'],
tasks: ['concat', 'uglify'],
options: {
livereload: true,
spawn: false
}
},
css: {
files: ['source/css/*.scss', 'source/css/**/*.scss', 'public/styleguide/css/**/*.scss'],
tasks: ['sass','autoprefixer'],
options: {
livereload: true,
spawn: false
}
}
}
});
// Plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-shell');
// Tasks
grunt.registerTask('default', ['concat', 'uglify', 'sass', 'watch', 'autoprefixer', 'shell:patternlab']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment