Comments (4)
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;
}
from gulp-uncss.
Ok. After changing the source to a single css file it works.
Seems it doesn't like:
return gulp.src(config.development.css.src + {style,style.ie}.css
Turns out it's because the style.ie.css file was empty.
from gulp-uncss.
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.
from gulp-uncss.
Cool. :)
from gulp-uncss.
Related Issues (20)
- It seems to not work with LESS HOT 1
- Unknown word, unable to parse undefined HOT 1
- No output HOT 1
- gulp-uncss breaks gulp-jspm HOT 2
- Incorrect output HOT 1
- Incomplete css HOT 1
- globbing patterns for ignore list HOT 1
- fontconfig error HOT 1
- Disable PhantomJS HOT 1
- Question: is it possible to use gulp-uncss with handlebars precompiled templates? HOT 1
- Works with URLs, not local HTML files on Windows (10) HOT 5
- "TypeError: Bad argument" in a dependency? HOT 7
- SetProcessDpiAwareness failed: "COM error 0x80070005 HOT 1
- Example task doesn't work - fn = function () { throw arg; }; HOT 1
- Nodeserver for uncss HOT 1
- Create separate css files per globed html input HOT 1
- Why are only html files supported? HOT 1
- Is it possible to report about deadcode only?
- SyntaxError: Unexpected token '{'
- ignore: is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-uncss.