Why I am not getting a new CSS file from gulp-uncss? -
i trying further compress css
file. , getting error peculiar. wondered why referenceerror: can't find variable: jquery
task solely encompasses selectors html & css? unless it's reading script tags in html have selectors?
update forgot mention task not spitting out, new css file!
also noticed many gulp tasks have ./
preceding directory, purpose of that? anyway, see below:
this gulp file, figured include it...
gulp.task('uncss', function() { return gulp.src('site/assets/stylesheets/style.min.81113a5b.css') .pipe(uncss({ html: [ 'site/**/*.html' ] })) .pipe(gulp.dest('./out')); });
this error getting.
referenceerror: can't find variable: jquery file:///users/antonioortiz/sites/antonioortiz.github.io/site/cookie_control/cookie_example/index.html:12 file:///users/antonioortiz/sites/antonioortiz.github.io/site/cookie_control/cookie_example/index.html:43 /users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/async.js:43 fn = function () { throw arg; }; ^ error: uncss/node_modules/css: unable parse undefined: missing '}' near line 1:46497 1: -> ebkit-min-device-pixel-ratio:0){@media{. @ error (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:57:15) @ declarations (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:224:26) @ rule (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:481:21) @ rules (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:103:56) @ atmedia (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:345:35) @ atrule (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:457:10) @ rules (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:103:44) @ stylesheet (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:73:16) @ object.module.exports [as parse] (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/css/node_modules/css-parse/index.js:485:10) @ process (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/src/uncss.js:158:22) @ trycatcher (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/util.js:26:23) @ promise._settlepromisefromhandler (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/promise.js:501:31) @ promise._settlepromiseat (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/promise.js:577:18) @ promise._settlepromises (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/promise.js:693:14) @ async._drainqueue (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/async.js:123:16) @ async._drainqueues (/users/antonioortiz/sites/antonioortiz.github.io/node_modules/gulp-uncss/node_modules/uncss/node_modules/bluebird/js/main/async.js:133:10)
taken uncss documentation:
how?
the process uncss removes unused rules follows:
- the html files loaded phantomjs , javascript executed.
- ...
this means page loaded in headless browser, library able find selectors used.
i never used uncss, seems me that:
- it throw js errors in case happen;
- it complain in case css not error-free.
that's why you're getting errors.
Comments
Post a Comment