Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to LESS 2.x nad CSSO 2.x (issue #77) #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions less-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define(['require', './normalize'], function(req, normalize) {
}
try {
var csslen = css.length;
css = csso.justDoIt(css);
css = csso.minify(css).css;
console.log('Compressed CSS output to ' + Math.round(css.length / csslen * 100) + '%.');
return css;
}
Expand Down Expand Up @@ -99,14 +99,13 @@ define(['require', './normalize'], function(req, normalize) {
cfg.filename = fileUrl;
cfg.async = false;
cfg.syncImport = true;
var parser = new less.Parser(cfg);
parser.parse('@import (multiple) "' + path.relative(baseUrl, fileUrl) + '";', function(err, tree) {
less.render('@import (multiple) "' + path.relative(baseUrl, fileUrl) + '";', cfg, function(err, output) {
if (err) {
console.log(err + ' at ' + path.relative(baseUrl, err.filename) + ', line ' + err.line);
return load.error(err);
}

var css = tree.toCSS(config.less);
var css = output.css;

// normalize all imports relative to the siteRoot, itself relative to the output file / output dir
lessBuffer[name] = normalize(css, fileUrl, siteRoot);
Expand Down