Questions tagged [webassets]

webassets is the asset management application for Python web development — use it to merge and compress your JavaScript and CSS files.

webassets is the asset management application for Python web development — use it to merge and compress your JavaScript and CSS files.

For some web frameworks, webassets provides some special integration:

But it can also be used with other frameworks or no framework at all.

40 questions
7
votes
1 answer

Issue using Flask-Assets to compile less files

I'm currently trying to set up a Flask web app, and trying to use Flask-Assets to compile my less files into minified css. Here is my assets.py file that creates the bundle. from flask_assets import Bundle common_css = Bundle( …
Paul Benigeri
  • 157
  • 2
  • 8
6
votes
1 answer

Flask Assets bundles not compiling when run under uWSGI

They run normally when I run the flask app directly but don't compile or replace the address in the template when run under uWSGI. How can I debug this? EDIT: code: assets = Environment(app) ... if __name__ == "__main__": …
Roman A. Taycher
  • 18,619
  • 19
  • 86
  • 141
4
votes
1 answer

How to use packaged assets with Flask-Assets

How can I bundle assets using Flask-Assets that exist outside of Flasks default static/ directory? I have npm install downloading assets into bower_components/ I have other javascripts that exist in javascripts/ I am using Flasks app factory…
user1236803
  • 183
  • 1
  • 3
  • 8
4
votes
1 answer

Flask-Assets and Flask-Testing throws RegisterError: Another bundle is already registered

I have my Flask app which uses Flask-Assets and while trying to run the unittest cases, except the first testcase, others fails with the following RegisterError. ====================================================================== ERROR:…
cnu
  • 36,135
  • 23
  • 65
  • 63
3
votes
1 answer

How to minify ES2016 or convert to ES2015 in flask?

I'm using flask-assets and none of the available filters (rjsmin, jsmin, closure_js, uglifyjs, etc.) is able to minify a ES2016 JavaScript file. The minified files yield errors on the browser console (due to bad conversions) or even crash on…
Carlos Vega
  • 1,341
  • 2
  • 13
  • 35
3
votes
1 answer

Autoprefixer Filter Not Working in Flask_Assets

I have tried to get the autoprefixer filter to work with flask_assets by following the instructions in the Flask_Assets documentation, but it does not appear to apply the filter. Here is my code: # construct flask app object from flask import Flask,…
R J
  • 4,473
  • 2
  • 22
  • 29
3
votes
0 answers

flask-assets: Deployed pages need to be reloaded a few times before they work

I'm use flask-assets for bundling, minification and versioning (making sure that when we change a CSS or JS file, the browser loads the new version, instead of what's in its cache... but of course we want it to load from the cache…
Michael Scheper
  • 6,514
  • 7
  • 63
  • 76
3
votes
2 answers

Why won't python webassets pyscss regenerate css from scss files in debug mode?

I'm using the pyscss compiler in the python webassets library with webassets debug configs all set to true. But when I make changes to an scss file and reload the page that includes the generated css file, I see that the css file has not be…
Julian A.
  • 10,928
  • 16
  • 67
  • 107
2
votes
1 answer

How do I pass libsass configuration variables into a flask_assets bundle?

My goal is to set LIBSASS_STYLE="expanded" via flask_assets.Bundle. The webassets libsass documentation says I can do it, but doesn't say how. My base app controller looks like the following. from flask import Flask, render_template from…
FinnM
  • 394
  • 1
  • 3
  • 17
2
votes
1 answer

Is flask-assets putting minified files in right directory?

I'm working to modify a cookiecutter Flask app. I'm working locally on WIN7 . I've set up bower to install the front end dependencies under the static root by using a .bowerrc file in the document root containing: { "directory" :…
user1592380
  • 34,265
  • 92
  • 284
  • 515
2
votes
1 answer

Flask-Assets not working at all... = Insanity

I have simply tried setting up flask-assets (based on webassets), however just can't get it to work. I have the standard setup; python virtualenv pip to install the bare essentials (flask, flask-assets) sass ruby gem (for trying sass / scss) less…
SiNGH
  • 31
  • 1
  • 4
2
votes
1 answer

Why am I getting KeyError: "Django settings doesn't define RESOLVER"?

I am getting the error below: (testassets)➜ testassets git:(master) ✗ django-admin.py test Creating test database for alias 'default'... E ====================================================================== ERROR:…
Paul
  • 1,192
  • 1
  • 11
  • 23
2
votes
2 answers

Using Flask-Assets with Flask-Mako

I would like to use flask-assets to organize my webassets and mako for templating. Flask-assets normally uses jinja in the following way: {% assets "js_all" %} {% endassets %} The…
jumbopap
  • 3,969
  • 5
  • 27
  • 47
2
votes
1 answer

Tell Webassets not to minify some code

I am using Flask Assets which uses Webassets. It does a great job of stripping my HTML. However it strips whitespace in one area where I do not want whitespace to be stripped. Is there a way to tell webassets not to strip the whitespace from one…
Johnston
  • 20,196
  • 18
  • 72
  • 121
2
votes
2 answers

pip - installation of sub-dependencies overrides other packages on requirements.txt

my requirements file is like that :…
eligro
  • 785
  • 3
  • 13
  • 23
1
2 3