小编Pau*_*eri的帖子

使用Flask-Assets编译较少的文件

我目前正在尝试设置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)

python less flask webassets flask-assets

6
推荐指数
1
解决办法
2682
查看次数

标签 统计

flask ×1

flask-assets ×1

less ×1

python ×1

webassets ×1