无法使用 python 为 libsass 设置 output_style 以在每次部署时编译 SASS

问题描述

这是关于如何通过 python 将 SASS 编译为 CSS 的文档,包括设置 output_style='compressed' 的可能性: https://sass.github.io/libsass-python/

import sass
sass.compile(dirname=('sass','css'),output_style='compressed')

以下是如何在每个部署者上执行此操作,这正是我所需要的: https://sass.github.io/libsass-python/frameworks/flask.html#building-sass-scss-for-each-deployment

# setyp.py

setup(
    # ...,setup_requires=['libsass >= 0.6.0'],sass_manifests={
        'myapp': ('static/sass','static/css','/static/css')
    }
)

但是,我需要在编译 SASS 时按照第二页中描述的方式设置 output_style,但我不知道该怎么做。有什么办法可以做到吗?

解决方法

找到解决方案

setup.cfg 更改如下:

[aliases]
sdist = build_sass --output-style compressed sdist
bdist = build_sass --output-style compressed bdist

插入

[aliases]
sdist = build_sass sdist
bdist = build_sass bdist

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...