Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

PHP Support #28

Closed
tonyspiro opened this issue Apr 23, 2015 · 4 comments
Closed

PHP Support #28

tonyspiro opened this issue Apr 23, 2015 · 4 comments

Comments

@tonyspiro
Copy link

Is there support for PHP? I'm getting this error:

gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/async.js:43
fn = function () { throw arg; };

Thanks!

@ben-eb
Copy link
Owner

ben-eb commented Apr 23, 2015

Yes and no. You need to run UnCSS on HTML that would be outputted from a PHP script, not on raw PHP files; so, serve your application on a local server and run UnCSS on the relevant URLs.

var gulp = require('gulp');
var uncss = require('gulp-uncss');

gulp.task('default', function() {
    return gulp.src('site.css')
        .pipe(uncss({
            html: ['http://localhost:3000/']
        }))
        .pipe(gulp.dest('./out'));
});

@tonyspiro
Copy link
Author

Thanks Ben, I've found that replacing uncss with version 0.10.0 fixes it as well:

https://github.com/giakki/uncss/tree/0.10.0

@ben-eb
Copy link
Owner

ben-eb commented Apr 23, 2015

Actually, I think this might be related to this issue: uncss/uncss#150

My advice would be to stick with 0.10.0 until 150 is resolved upstream.

@AdletKoshanov
Copy link

THANK YOU
I did so: html: ['http://localhost/project/']

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants