Questions tagged [clean-css]

clean-css is a fast and efficient CSS optimizer for the Node.js platform and any modern browser

enter image description here

clean-css is a fast and efficient CSS optimizer for the Node.js platform and any modern browser.

According to tests it is one of the best available.

How to Install

npm install --save-dev clean-css

Usage

var CleanCSS = require('clean-css');
var input = 'a{font-weight:bold;}';
var options = { /* options */ };
var output = new CleanCSS(options).minify(input);
34 questions
8
votes
1 answer

Concatenate/relocate CSS files with Gulp

I'm looking for a plugin chain to use with Gulp that provides: source map support less minification concatenation URL replacement (rebase) to address relocation/concat I currently have the first four, but I can't find a combination of existing…
shannon
  • 8,664
  • 5
  • 44
  • 74
7
votes
3 answers

Angular 5: ng build - -prod fails due to clean-css: Cannot read property 'line' of undefined

My app is under Angular 5.2.6. Things are normal with ng serve, but when running ng build --prod, it takes a while, before failing. The errors seem to have to do with the clean-css actions. Error trace: 92% chunk asset…
firasKoubaa
  • 6,439
  • 25
  • 79
  • 148
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
1 answer

Broken CSS keyframe animations when using WebPack's css-loader with UglifyJS plugin

We're using este.js dev stack in our application which uses webpack to bundle JS & CSS assets. Webpack is configured to use webpack.optimize.UglifyJsPlugin when building for production env and stylus-loader, well the exact loader configuration for…
Marek Suscak
  • 1,086
  • 10
  • 25
4
votes
0 answers

Why does minify-all fail with "cleancss not found" error unless I install cleancss via sudo?

When I run my npm install I can see that clean-css is installed! It shows in the directory correctly. No matter how many times I re-install, or even npm install -g clean-css, it keeps throwing the error. but if I install clean-css as a super user,…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
3
votes
1 answer

Ember how to update NPM package clean-css

NPM Audit shows there is a low level vulnerability in clean-css that is patched in >= 4.1.11. === npm audit security report === Manual Review …
J Weezy
  • 3,507
  • 3
  • 32
  • 88
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
1 answer

cleancss command not working

I installed clean-css locally but my npm script is throwing an error because cleancss is not found (sh: cleancss: command not found). I tried running cleancss straight from the command line and installed it globally (npm install -g clean-css) but my…
mrtnmgs
  • 1,402
  • 14
  • 26
3
votes
2 answers

Running Less.js for windows with Clean-Css enabled get "object has no method 'install' error

I am using the following git:less.js-windows. I've installed clean-css with the following command: npm install -g less-plugin-clean-css now I am trying to run lessc with this: lessc -clean-css main.less main.css and I get the following…
Ori Price
  • 3,593
  • 2
  • 22
  • 37
2
votes
1 answer

Unable to load plugin clean-css please make sure that it is installed under or at the same level as less

I have a bash script that minifies all my less files and outputs the result into a .min.css file. I have already looked at other answers on similar questions, but nothing works. After updating to Mac OS Catalina today my bash script stopped working…
IT-Girl
  • 448
  • 5
  • 24
2
votes
1 answer

How to pipe requests into clean-css in nodejs?

I'm trying to pipe request output into clean-css to minify and then provide it as a response. The example app in question is built on restify. Sample Objective Code : var url =…
Dragunov
  • 975
  • 1
  • 7
  • 14
2
votes
1 answer

Clean-css NPM Command not found

I am trying to use clean-css to minify my CSS files using a simple terminal command on Mac. I have tried everything from installing an older version of clean-css like this: npm install clean-css@3.4.25 --save to installing the command line version…
Hudson Taylor
  • 1,142
  • 2
  • 10
  • 30
2
votes
1 answer

Grunt cssmin / CleanCSS source map rebasing

I'm using cssmin with the following "Content" folder structure: src |--dir1 | |--style1.css | |--images | |--image1.png |--dir2 |--style2.css |--images |--image2.png dist |--styles.min.css |--styles.min.css.map Where…
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