Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created May 9, 2013 11:42
Show Gist options
  • Save lmartins/5546983 to your computer and use it in GitHub Desktop.
Save lmartins/5546983 to your computer and use it in GitHub Desktop.
Multiple compiles with grunt-watch
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
sassDir: 'css-src',
cssDir: 'css',
environment: 'production',
outputStyle: 'expanded',
debugInfo: true
}
}
},
webfont: {
icons: {
src: 'css-src/iconfont/icons/*.svg',
dest: 'css-src/iconfont',
destCss: 'css-src/iconfont',
options: {
stylesheet: 'scss',
relativeFontPath: '../css-src/iconfont/',
htmlDemo: true,
syntax: "bootstrap"
}
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: ['dist/js/**/*.js'],
options: {
nospawn: true
}
},
js: {
files: ['src/js/**/*.js'],
tasks: ['concat']
},
html: {
files: ['**/*.html']
},
css: {
files: 'css-src/**/*.scss',
tasks: ['compass']
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-webfont');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-notify');
// Default task(s).
grunt.registerTask('default', ['watch']);
grunt.registerTask('js', ['concat']);
grunt.registerTask('icons', ['webfont']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment