Search code examples
pythoncssflasksassflask-assets

Flask_Assets not export css from sass


I'm using Flask_Assets to load sass into Flask.

My code is that:

from flask_assets import Environment, Bundle

assets = Environment(app)
scss = Bundle(
        'scss/modal.scss',
        'scss/buttons.scss'
        filters='pyscss',
        output='all.css'
)
assets.register('scss_all', scss)

I make changes to sass files but they are not automatically exported to css.

Someone knows how to make them export or some command to export manually from the console?

Thanks!!!!


Solution

  • I found answer in this question: https://stackoverflow.com/a/17132137/7290770

    from flask_assets import Environment, Bundle
    assets = Environment(app)
    scss = Bundle(
            'scss/modal.scss',
            'scss/buttons.scss'
            filters='pyscss',
            depends=('**/*.scss'),
            output='all.css'
    )
    assets.register('scss_all', scss)