barebones/Gruntfile.js

93 lines
1.8 KiB
JavaScript
Raw Normal View History

2014-02-21 11:23:33 +01:00
module.exports = function(grunt) {
2014-06-20 16:59:08 +02:00
var paths = {
img: 'img/'
};
2014-02-21 11:23:33 +01:00
grunt.initConfig({
2014-06-20 16:59:08 +02:00
compass: {
options: {
config: 'config.rb',
bundleExec: true
},
dev: {
options: {
specify: 'scss/style.scss',
}
},
prod: {}
},
imageoptim: {
src: [paths.img],
options: {
quitAfter: true
2014-02-21 11:23:33 +01:00
}
},
sass: {
dist: {
options: {
style: 'compressed'
},
2014-06-20 16:59:08 +02:00
files: { 'style.css': 'scss/style.scss' }
2014-02-21 11:23:33 +01:00
}
},
2014-05-08 12:24:17 +02:00
svgmin: {
options: {
plugins: [{
removeViewBox: false
}],
},
dist: {
files: [{
expand: true,
2014-06-20 16:59:08 +02:00
cwd: paths.img,
2014-05-08 12:24:17 +02:00
src: ['*.svg'],
2014-06-20 16:59:08 +02:00
dest: paths.img,
2014-05-08 12:24:17 +02:00
ext: '.svg'
}],
}
},
svg2png: {
all: {
files: [{
2014-06-20 16:59:08 +02:00
src: [paths.img + '*.svg'],
dest: paths.img
2014-05-08 12:24:17 +02:00
}],
}
},
2014-05-08 17:45:41 +02:00
jshint: {
all: ['js/script.js']
2014-05-08 17:45:41 +02:00
},
2014-05-08 12:24:17 +02:00
uglify: {
all: {
files: { 'script.js': 'js/*.js' }
}
},
2014-02-21 11:23:33 +01:00
watch: {
css: {
2014-06-20 16:59:08 +02:00
files: ['scss/**/*.scss'],
2014-02-21 11:23:33 +01:00
tasks: ['sass'],
options: {
livereload: true
}
2014-05-08 12:24:17 +02:00
},
js: {
files: ['js/*.js'],
2014-05-08 17:45:41 +02:00
tasks: ['uglify', 'jshint']
2014-02-21 11:23:33 +01:00
}
}
});
2014-06-20 16:59:08 +02:00
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-jshint');
2014-02-21 11:23:33 +01:00
grunt.loadNpmTasks('grunt-contrib-sass');
2014-06-20 16:59:08 +02:00
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-imageoptim');
2014-05-08 12:24:17 +02:00
grunt.loadNpmTasks('grunt-svg2png');
grunt.loadNpmTasks('grunt-svgmin');
2014-02-21 11:23:33 +01:00
2014-06-20 16:59:08 +02:00
grunt.registerTask('default', ['imageoptim', 'sass', 'svgmin', 'svg2png', 'watch', 'uglify', 'jshint']);
2014-02-21 11:23:33 +01:00
2014-06-03 12:34:51 +02:00
};