我目前正在尝试设置Flask Web应用程序,并尝试使用Flask-Assets将较少的文件编译为缩小的CSS.
这是我创建捆绑包的assets.py文件.
from flask_assets import Bundle
common_css = Bundle(
'vendor/less/theme.less',
filters='less',
output='static/css/common.css',
)
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
OSError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)
在较少过滤器的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 …Run Code Online (Sandbox Code Playgroud)