Questions tagged [gulp-clean-css]

A Gulp plugin that minifies css with clean-css

A simple gulp plugin, which means it's nothing more than a thin wrapper around clean-css.

33 questions
17
votes
2 answers

Remote font imports with css minification

I'm trying to concatenate & minify all bower package assets including css. One of them is bootswatch design and it imports google fonts. Problem is, running css tasks on it results in timeout exception. I'm guessing it is trying to download those…
Felini
  • 465
  • 4
  • 15
15
votes
2 answers

Gulp minifyCss remove special comments

I am using gulp minifyCss to minify my css to reduce filesize. My gulp task looks something like this: gulp.task('minify-css', function() { return gulp.src('styles/*.css') .pipe(concatCss("all.css").on('error', standardHandler)) …
user1995781
  • 19,085
  • 45
  • 135
  • 236
7
votes
1 answer

Prevent gulp to minify code on local machine

I started a project with [RDash angular dashboard][1] which using gulp. this is the first time I work with gulp and the problem is that while I'm working locally I can't debug because it minify css/js/html files. How can I prevent from gulp to…
Lior Bachar
  • 103
  • 2
  • 8
6
votes
1 answer

Remote Import Fonts with Gulp

So I'm noticing that my current Gulp setup isn't importing remote fonts such as google fonts. In my main.scss file I have: @import…
erwstout
  • 1,277
  • 1
  • 13
  • 30
5
votes
2 answers

gulp-clean-css cannot set the right relative path for url() for assets such as fonts and images

I use NPM and Gulp for my package manager and build system. I have installed "gulp-sass" to support sass, and "gulp-clean-css" so that I can @import css files inline. I capture my SCSS files in "_frontend/scss/**/*", and compiles that into a single…
Thomas Cheng
  • 695
  • 12
  • 26
5
votes
2 answers

gulp-sass compiles Google Fonts CSS into the file, breaks protocol-relative link

When I use the following code in my .scss file @import url('//fonts.googleapis.com/css?family=SomeFont:400,700,400italic'); the SASS parser I use (nodejs gulp-sass) happily downloads the file from said location and includes it as plain text in the…
SeinopSys
  • 8,787
  • 10
  • 62
  • 110
4
votes
1 answer

Bootstrap 4. CSS minification produces wrong results

I have installed Bootstrap 4.0-alpha with Bower and now I have a dist directory with precompiled bootstrap.css and bootstrap.min.css. In development environment I try to use not compressed version, but minified version within deployment. I use…
3
votes
1 answer

How to remove special comments in gulp clean-css?

How to remove special comments in gulp clean-css? .pipe(cleancss({specialComments: 0})) seems to have no effect
Lukas Pierce
  • 807
  • 3
  • 9
  • 15
3
votes
0 answers

Gulp - delete old bundles when new are formed

I am really new to gulp and I am struggling with making a build process which seems fairly simple but I am not able to crack it. What I want to achieve is that all my js and css files to be bundled and bundled to be named as all_*.min.js where * is…
3
votes
1 answer

gulp-sourcemaps with gulp-minify-css crashes

I'm compiling bootstrap-sass with the gulp task: gulp.task('build-bootstrap-sass', function () { return gulp.src('styles/styles.sass') .pipe(sourcemaps.init()) .pipe(sass({includePaths:…
Meirion Hughes
  • 24,994
  • 12
  • 71
  • 122
2
votes
1 answer

Gulp is creating a directory instead of a file

I want gulp to spit out a style.min.css: // Minify gulp.task('minify-css', function () { gulp.src('css/style.css') .pipe(cleanCSS()) .pipe(gulp.dest('css/style.min.css')) }); it is minifying the .css but instead is creating a…
Labanino
  • 3,902
  • 9
  • 33
  • 51
2
votes
1 answer

How to keep my relative paths with clean-css minifying?

Why does gulp code below remove my relative paths? I am using clean-css: gulp.task('build-css', function() { return gulp.src([ 'style.css', ]) .pipe(sourcemaps.init()) .pipe(cleanCSS({debug: true})) …
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
1 answer

Cannot read property 'line' of undefined at originalPosition in gulp-clean-css plugin

As mentioned in the question, when I launch gulp build I get the following error: C:\dev\work\viewAngular\web\node_modules\gulp-clean-css\node_modules\clean-css\lib\reader\input-source-map-tracker.js:37 if (originalPosition.line === null && line > 1…
mqrdram
  • 17
  • 3
2
votes
2 answers

Minification error with minifycss

I've got this gulp css minification line: .pipe(minifycss({advanced:false, keepSpecialComments : 0}).on('error', gutil.log)) When i minify this css part: .mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, .mCS-rounded-dots-dark.mCSB_scrollTools…
Mike
  • 5,416
  • 4
  • 40
  • 73
2
votes
1 answer

clean-css TypeError cannot read property '0' of null

I am trying to minify my code and i always get this error when it runs clean-css. /home/k1ngsley/Projects/mobile_rea/partners-mobile-app/node_modules/clean-css/lib/selectors/extractor.js:66 return name.replace(/^\-\w+\-/,…
Kingsley Simon
  • 2,090
  • 5
  • 38
  • 84
1
2 3