addyosmani / addyosmani/gulp-uncss-task

How to use gulp-uncss-task for remote files

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
61
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

説明

I've asked the question on StackOverflow: http://stackoverflow.com/questions/24538052/how-to-use-gulp-uncss-task-for-remote-files but just for clarity I'm c/p-ing this here:

**Preface**:
I'm using [uncss](https://github.com/giakki/uncss) and, as the instructions say, using it from a command line is straight forward:

```
uncss [options]
e.g. uncss http://getbootstrap.com/examples/jumbotron/ > stylesheet.css
```

And, as stated this works with remote files (even php scripts), so that I can for example call:

```
uncss http://www.example.com/myPage.php > myPage.css
```

and it would work flawlessly.

Also, I got it working in Node.js app (as per instructions from the documentation):

```
var uncss = require('uncss');

var files = [],
options = {
urls : ['http://www.example.com/myPage.php'], // Deprecated
};

uncss(files, options, function (error, output) {
console.log(output);
});
```

I'm wondering why the `Deprecated` comment up in the `urls` - I couldn't find any additional info for this?

**Actual question**: Since I use gulp to run my build tasks I would like to use [gulp-unss-task](https://github.com/addyosmani/gulp-uncss-task) to achieve the same thing (uncssing the remote file) so that I could then pipe it further to the minimization task. As it seems from the documentation this is not possible, but would appreciate if someone dealt with this before and maybe has a solution.

The usage docs for gulp-uncss-task:

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

gulp.task('default', function() {
gulp.src('bootstrap.css')
.pipe(uncss({
html: ['index.html', 'contact.html', 'about.html']
}))
.pipe(gulp.dest('dest'));
});
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。