Last active
August 29, 2015 14:17
-
-
Save stowball/366f1f478861fd16f515 to your computer and use it in GitHub Desktop.
How to grunt watch sass then autoprefix css?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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']); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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