This repository has been archived by the owner on Dec 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Using gulp-uncss with postcss #39
Comments
Works fine for me: var postcss = require('gulp-postcss');
var uncss = require('gulp-uncss');
var gulp = require('gulp');
gulp.task('default', function () {
return gulp.src('./fixture.css')
.pipe(postcss([ require('postcss-size') ]))
.pipe(uncss({html: ['./index.html']}))
.pipe(gulp.dest('out'));
}); fixture.css: h1, h2 {
size: 50px;
} index.html: <html><body><h1>hello</h1></body></html> output: h1 {
width: 50px;
height: 50px;
} |
Ok. After changing the source to a single css file it works. Seems it doesn't like:
Turns out it's because the style.ie.css file was empty. |
ben-eb
added a commit
that referenced
this issue
Sep 24, 2015
OK, no problem. I've added a check that will simply pass through the CSS when the file is empty; as uncss'ing an empty string should return an empty string and not a crash. 😄 It's available since 1.0.4. |
Cool. :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm having an issue getting gulp-uncss playing nicely with postcss. I was originally using gulp-sass which worked fine.
But using postcss I get this error:
My gulp css task looks like this:
Anything obvious as to why it's not working?
The text was updated successfully, but these errors were encountered: