Last 12 weeks · 0 commits
2 of 6 standards met
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 and, as the instructions say, using it from a command line is straight forward: And, as stated this works with remote files (even php scripts), so that I can for example call: and it would work flawlessly. Also, I got it working in Node.js app (as per instructions from the documentation): I'm wondering why the comment up in the - 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 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:
Addy recommended I open an issue for this, so here goes. Let's say I have a single HTML page that references a single stylesheet, and I want to check that stylesheet for unnecessary rules. I figured the following trivial gulpfile would work: Unfortunately, running results in containing the optimized content of _twice_. If I remove the reference to from , the resulting CSS is fine. However, adding a element after UnCSS processes the HTML is tedious and doesn't seem like the right approach, especially since UnCSS figures out the list of stylesheets from the HTML in the first place. I've tried passing an empty array to the function, as well as setting the to , but that didn't change anything. I also tried putting the source HTML and CSS in the package root directory, because I thought it might be something path-related; no luck though. To confirm, I tested with UnCSS itself. The following code works as expected, returning the optimized CSS a single time: I'm using gulp 3.2.2 and gulp-uncss-task 0.1.0, on Windows 8 x64. For the sake of completeness, here are my HTML and CSS: Am I missing something obvious? Thanks.
Repository: addyosmani/gulp-uncss-task. Description: [Deprecated] Use gulp-uncss instead please. Stars: 62, Forks: 9. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v0.2.2 (12y ago). Open PRs: 0, open issues: 3. Last activity: 11y ago. Community health: 42%. Top contributors: addyosmani, tomByrer, armno, stevemao.