【发布时间】:2014-02-02 06:32:41
【问题描述】:
我目前正在尝试设置一个 Flask 网络应用程序,并尝试使用 Flask-Assets 将我的 less 文件编译成缩小的 css。
这是创建捆绑包的 assets.py 文件。
from flask_assets import Bundle
common_css = Bundle(
'vendor/less/theme.less',
filters='less',
output='static/css/common.css',
)
我得到的错误是:
OSError: [Errno 2] No such file or directory
在less filter 的webassets 文档中,它说:
This depends on the NodeJS implementation of less, installable via npm. To use the old Ruby-based version (implemented in the 1.x Ruby gem), see Less.
...
LESS_BIN (binary)
Path to the less executable used to compile source files. By default, the filter will attempt to run lessc via the system path.
我使用$ npm install less 安装了less,但由于某种原因,webassets 似乎无法使用它。
当我尝试使用不同的过滤器时,webassets 可以成功创建捆绑包。
谢谢!
【问题讨论】:
标签: python flask less webassets flask-assets