hyde/hyde — Issue #148: lesscss plugin does not allow import from outside the content root
Author: jfaust
Created: 2012-02-12 09:35:44+00:00
State: open

The lesscss plugin replaces `@import` statements with template include statements, which is unexpected, and the way it's done means you cannot import things from outside the content root.

This poses a problem because *every* .less file within the content root is processed by the less plugin, even .less files that are not valid on their own (but are valid after being imported into another .less file).

Also, this means that `@import` will be processed as a template, even though I'm not explicitly using `{%include%}`, which seems a bit odd.

I've hacked a solution that allows `@import` to work as expected by removing `begin_text_resource()` from the plugin and setting the working directory when executing `lessc` by replacing the `self.call_app()` call with:

```
cwd = os.path.dirname(resource.source_file.fully_expanded_path)
subprocess.check_output(args, cwd=cwd)
```

I can submit a real patch if this is considered the right solution.