How to use the csso.justDoIt function in csso

To help you get started, we’ve selected a few csso examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github royriojas / simpless / index.js View on Github external
if ( args.cancel ) {
              return;
            }

            var result = results.join( os.EOL );

            var banner = opts.banner ? opts.banner + os.EOL : '';

            write( dest, (banner + result) );

            me.fire( 'write:file', args );

            if ( opts.minimize ) {
              var csso = require( 'csso' );
              var cssoOptions = opts.cssoOptions || { };
              var minimized = csso.justDoIt( result, !!cssoOptions.structureModifications );
              var minimizedDest = makeMinName( dest );

              write( minimizedDest, (banner + minimized) );

              me.fire( 'write:minimized', extend( { }, args, {
                dest: minimizedDest
              } ) );
            }

          } ).catch( function ( err ) {
            //console.log(err);
github unprolix / bastard / bastard.js View on Github external
var tagName = token[1];
					var tagNameLC = tagName.toLowerCase ();
					if (tagNameLC == 'script') {
						insideScriptTag = false;
					} else if (tagNameLC == 'style') {
						insideCSSTag = false;
					}
					processed += "";
					break;
				case 4:
					if (insideScriptTag) {
						if (debug) console.info ("Minifying inline javascript: " + insideScriptTag);
						processed += minifyJavascript (token[1], null);
					} else if (insideCSSTag) {
						if (debug) console.info ("Minifying inline CSS: " + insideCSSTag);
						processed += csso.justDoIt (token[1]);
					} else {
						processed += token[1];
					}
					break;
			}
		} while (token[0]);
		
		if (SHOW_PRE_MINIFIED_HTML) {
			console.info ("-------- PRE-MINIFIED HTML --------");
			console.info (processed);
			console.info ("-----------------------------------");
		}
	
		var minified = html_minifier.minify (processed, {
			removeComments: true,
			removeCommentsFromCDATA: true,
github azproduction / lmd / bin / lmd_builder.js View on Github external
LmdBuilder.prototype.renderStyles = function (styles, isOptimizeCss) {
    if (!styles || !styles.length) {
        return '';
    }

    var allCss = styles
        .filter(function (style) {
            return style.is_exists;
        })
        .map(function (style) {
            return fs.readFileSync(style.path, 'utf8');
        })
        .join('\n');

    return isOptimizeCss ? csso.justDoIt(allCss, true) : allCss;
};
github caseywebdev / cogs / src / transformers / csso.js View on Github external
module.exports = function (file, options, cb) {
  var source = file.buffer.toString();
  try { source = csso.justDoIt(source) + '\n'; }
  catch (er) { return cb(er); }
  cb(null, {buffer: new Buffer(source)});
};
github nodeca / nodeca.core / lib / init / assets / mincer / compression.js View on Github external
function css_compressor(str) {
  return Csso.justDoIt(str);
}
github pierrec / js-xxhash / node_modules / lmd / bin / lmd_builder.js View on Github external
LmdBuilder.prototype.renderStyles = function (styles, isOptimizeCss) {
    if (!styles || !styles.length) {
        return '';
    }

    var allCss = styles
        .filter(function (style) {
            return style.is_exists;
        })
        .map(function (style) {
            return fs.readFileSync(style.path, 'utf8');
        })
        .join('\n');

    return isOptimizeCss ? csso.justDoIt(allCss, true) : allCss;
};
github enb / enb / techs / csso.js View on Github external
return vowFs.read(sourcePath, 'utf8').then(function(data) {
            data = csso.justDoIt(data, preserveStructure);
            return vowFs.write(targetPath, data, 'utf8');
        });
    }

csso

CSS minifier with structural optimisations

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis