a simple starting-point gruntfile for builds
module.exports = function (grunt) {
grunt.initConfig({
clean: {
pre: [
'.tmp/',
'build/'
],
post: [
'.tmp/'
]
},
copy: {
main: {
expand: true,
cwd: 'src',
src: 'index.html',
dest: 'build/',
filter: 'isFile'
},
fonts: {
expand: true,
cwd: 'src',
src: 'fonts/**',
dest: 'build/'
},
images: {
expand: true,
cwd: 'src',
src: 'img/**',
dest: 'build/'
}
},
useminPrepare: {
html: 'src/index.html',
options: {
dest: 'build/'
}
},
usemin: {
html: ['build/index.html']
},
uncss: {
dist: {
options: {
// bootstrap stuff
ignore: [/collaps/, /modal/, /active/, /rotate/, /show/, /fade/],
// process the concatenated file, not the dev files
stylesheets: ['../.tmp/concat/css/style.css']
},
files: {
'build/css/style.css': [
'src/index.html',
'src/partials/*.html'
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-uncss');
grunt.registerTask('build', ['clean:pre', 'copy', 'useminPrepare', 'concat:generated', 'uncss', 'uglify:generated', 'usemin', 'clean:post']);
};