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

v1.1.0 error #144

Closed
XhmikosR opened this issue Sep 6, 2013 · 5 comments
Closed

v1.1.0 error #144

XhmikosR opened this issue Sep 6, 2013 · 5 comments

Comments

@XhmikosR
Copy link
Contributor

XhmikosR commented Sep 6, 2013

C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\images\url-rewriter.js:42
      throw new Error('Relative url found: \'' + url + '\' but there is no way            ^
Error: Relative url found: '../font/fontawesome-webfont-3.2.1.eot' but there isno way to resolve it (hint: use `root` or `output` options)
    at Object.module.exports._rebased (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\images\url-rewriter.js:42:13)
    at Object.module.exports.process (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\images\url-rewriter.js:21:35)
    at Object.module.exports.process (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\images\url-rebase.js:19:24)
    at Object.rebaseUrls [as 0] (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\clean.js:243:24)
    at replace (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\clean.js:26:21)
    at Object.CleanCSS.process (C:\Users\xmr\Desktop\website - Copy\node_modules\clean-css\lib\clean.js:242:5)
    at minify (C:\Users\xmr\Desktop\website - Copy\make.js:42:32)
    at Function.target.website (C:\Users\xmr\Desktop\website - Copy\make.js:143:9)
    at Object.target.(anonymous function) [as website] (C:\Users\xmr\Desktop\website - Copy\node_modules\shelljs\make.js:28:26)
    at Function.target.rebuild (C:\Users\xmr\Desktop\website - Copy\make.js:172:16)

The exact same css files with the exact same commands worked with 1.0.12...

function writeText(file, text) {
    var content = fs.writeFileSync(file, text, "utf-8");
    return content;
}


function minify() {
    var cleanCSS = require("clean-css");
    var uglifyJS = require("uglify-js");

    cd(srcDir);

    echo();
    echo("### Combining css files...");

    // pack.css
    var inCss = cat(["_static/css/bootstrap.css",
                     "_static/css/font-awesome.css",
                     "_static/css/jquery.fancybox.css",
                     "_static/css/jquery.fancybox-thumbs.css",
                     "_static/css/style.css"]);

    var minifiedCss = cleanCSS.process(inCss, {
        removeEmpty: true,
        keepSpecialComments: 0
    });

    writeText(buildTarget + "_static/css/pack.css", minifiedCss);
}
@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 6, 2013

Basically it now needs root otherwise it fails:

    var minifiedCss = cleanCSS.process(inCss, {
        removeEmpty: true,
        keepSpecialComments: 0,
        root: buildTarget
    });

Can't you make this behave like 1.0.12?

@GoalSmashers
Copy link
Contributor

That's a breaking change thus we are now at 1.1.x not 1.0.x. No one said it would be straightforward.

Question: what '../font/fontawesome-webfont-3.2.1.eot' turns into in the pack.css file?

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 6, 2013

It stays the same, which is what I wanted in the first place. But why does it need a root option then...

@GoalSmashers
Copy link
Contributor

Well it shouldn't have required root at all. So with the last change clean-css trusts that you know what you are doing. 1.1.1 release is imminent - thanks for raising this issue.

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 7, 2013

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants