eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.47k stars 314 forks source link

Could not call YUICSSOptimizer/ClosureJSOptimizer #103

Closed richardcornish closed 10 years ago

richardcornish commented 10 years ago

When I run cactus build or cactus serve, I get errors related to my use of optimize in config.json:

Could not call external processor YUICSSOptimizer: [Errno 2] No such file or directory
Could not call external processor ClosureJSOptimizer: [Errno 2] No such file or directory

When I load up a console, importing them like static/static_optimizers.py does loads them no problem, so I don't know what I'm doing wrong.

>>> from cactus.contrib.external.yui import YUICSSOptimizer`

I'm using the v3 branch.

My config.json:

{
    "fingerprint": [
        "js",
        "css"
    ],
    "optimize": [
        "js",
        "css"
    ],
    "prettify": true
}
krallin commented 10 years ago

You're probably missing YUI or the closure compiler on your workstation.

Cheers, On Aug 30, 2014 7:19 AM, "Richard Cornish" notifications@github.com wrote:

When I run cactus build or cactus serve, I get errors related to my use of optimize in config.json:

Could not call external processor YUICSSOptimizer: [Errno 2] No such file or directory Could not call external processor ClosureJSOptimizer: [Errno 2] No such file or directory

When I load up a console, importing them like static/static_optimizers.py does loads them no problem, so I don't know what I'm doing wrong.

from cactus.contrib.external.yui import YUICSSOptimizer`

I'm using the v3 branch.

My config.json:

{ "fingerprint": [ "js", "css" ], "optimize": [ "js", "css" ], "prettify": true }

— Reply to this email directly or view it on GitHub https://github.com/koenbok/Cactus/issues/103.

krallin commented 10 years ago

Just to clarify that last point

The IOError you are seeing is for the external processor (e.g. closure compiler). It's not for the plugin file.

Cheers,

richardcornish commented 10 years ago

Thanks, I didn't realize they were external dependencies. Both can be installed with Homebrew. I installed YUI, but Closure requires Java 7, which is no longer installed on Mavericks.

I like the lightweight idea of the plugin system, but the front-end related ones seem to cover near identical ground to Grunt. Optimizing and fingerprinting is good, but there's no uglifying or concatenating. Forgive me if I'm not seeing the larger picture.

krallin commented 10 years ago

Hi there,

The plugin system is intentionally very flexible, and actually gives you sufficient flexibility to integrate with the frontend framework(s) of your choice (i.e. your plugin can totally rewrite Cactus's list of discovered static assets, and Cactus won't mind).

For one, I integrated with require.js and scss (I believe grunt wasn't really a thing just yet when I worked on this).

So, to answer your original question. Yes, the built-in minification plugins are a lightweight solution. However, if you find them too limited, or somehow just prefer something else, you definitely don't have to use them.

Cheers, On Aug 31, 2014 12:15 AM, "Richard Cornish" notifications@github.com wrote:

Closed #103 https://github.com/koenbok/Cactus/issues/103.

— Reply to this email directly or view it on GitHub https://github.com/koenbok/Cactus/issues/103#event-159321397.

AeonFr commented 8 years ago

Sorry for being so basic, but I have no idea how to install YUI whatsoever, so I looked it in the Ubuntu Software Center and found at leat 4 packages that have "YUI" in the name, but after installing a few the error keeps appearing :/ yui-what

I'm also getting the ClosureJSOptimiser message, and I don't wanna keep messing up with things I don't understand, as long as I don't have to. Is there anything wrong in systematically ignoring this messages?

richardcornish commented 8 years ago

YUICSSOptimizer is the name of a Cactus plugin. Under the hood it uses YUI Compressor, which is a Java jar package. The GitHub page is at https://github.com/yui/yuicompressor.

ClosureJSOptimizer is also the name of a Cactus plugin. It uses Google Closure Compiler, which is a also a Java jar package. The GitHub page is at https://github.com/google/closure-compiler.

I have a Mac, and thus use Homebrew to make my life easy to install these packages. If you're on Ubuntu, it seems like the best thing to do would be to create your own builds with Ant, which seems to be available as an Ubuntu package (apt-get install ant). But first you would need Java on Ubuntu because Ant, YUI Compressor, and Google Closure Compiler all require it as a dependency.

AeonFr commented 8 years ago

OK, thanks for the advice.... I've already checked and I do have java in my computer. I didn't knew how to install the pacakges after downloading them, I will check Ant later :+1: