0

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!!!!

laurajaime
  • 379
  • 1
  • 3
  • 14
  • It's not clear whether this works in the first place, and further changes aren't exported, OR nothing exports correctly at all? If the former, does restarting the flask app cause the changes to export correctly? – v25 Jan 23 '20 at 20:24
  • Doesn't export anything I write on the scss to css. This should generate a css with scss and it doesn't. – laurajaime Jan 24 '20 at 06:24
  • This is powered by webassets, have you tried one of the other [supported filters](https://webassets.readthedocs.io/en/latest/builtin_filters.html)? For `pyscss`it says `The PyScss module needs to be installed. It’s API has been changing; currently, version 1.1.5 is known to be supported.` You could try with another filter like `filter='scss'`. – v25 Jan 24 '20 at 10:44
  • Doesn't export automatically, maybe there is a command I can launch in terminal from the project folder. – laurajaime Jan 24 '20 at 19:37

1 Answers1

1

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)
laurajaime
  • 379
  • 1
  • 3
  • 14