Skip to content

Instantly share code, notes, and snippets.

@stowball
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save stowball/366f1f478861fd16f515 to your computer and use it in GitHub Desktop.

Select an option

Save stowball/366f1f478861fd16f515 to your computer and use it in GitHub Desktop.
How to grunt watch sass then autoprefix css?
sass: {
dev: {
files: [{
expand: true,
cwd: 'css/lib',
src: ['**/*.scss'],
dest: 'css/stage',
ext: '.css'
}]
}
},
autoprefixer: {
prefix: {
src: ['css/stage/**/*.css'],
dest: 'css'
}
},
watch: {
sass: {
files: ['css/lib/**/*.scss'],
tasks: ['sass:dev'],
options: {
spawn: false
}
},
css: {
files: ['css/stage/**/*.css'],
tasks: ['autoprefixer'],
options: {
spawn: false
}
}
}
grunt.registerTask('css', ['sass:dev', 'autoprefixer', 'watch']);
@stowball
Copy link
Copy Markdown
Author

This doesn't work. Watch doesn't detect the changes to the generated CSS.

If I ran autoprefixer inside of the sass watch it works, but it takes too long as there are so many files. Ideally I'd like to use grunt-newer in with it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment