Questions tagged [flask-assets]

Flask-Assets is an extension for Flask, it helps with easy integration of webassets into a Flask app. Use this tag for related questions.

Flask-Assets is an extension for the framework. It allows one to easily integrate functionality into a Flask app. For more information visit its homepage.

48 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
5
votes
0 answers

Override url_for globally so that extensions use it as well

I'm trying to override the url_for function globally. I want to do this so that I can load my assets from multiple urls to overcome the browser's maximum concurrent connections limit. I used app.context_processor to substitute my own function in…
Nixxxon
  • 158
  • 1
  • 9
4
votes
3 answers

How to uglify ES6 javascript with Flask?

I'm searching a Flask-Assets filter that allows me to uglify javascript and support ES6 syntax. I tried to use uglifyjs-es binary instead of uglifyjs but I can't figure out how to configure my filter to use the uglifyjs-es binary. I've this:…
snoob dogg
  • 2,491
  • 3
  • 31
  • 54
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
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
2 answers

Cant import scss file from another folder with Flask-assets and pyscss

I am using scss and flask-assets in my flask app. Here's my app.py : from flask_assets import Bundle, Environment from flask import (Flask, render_template) import os app = Flask(__name__) assets = Environment(app) assets.url =…
David Geismar
  • 3,152
  • 6
  • 41
  • 80
3
votes
1 answer

Cant generate all.css file from sass files with flask-assets

I became tired of using css in my flask app so I decided to move to scss with flask assets https://github.com/miracle2k/flask-assets. I added this in my app.py file: from flask_assets import Environment, Bundle assets =…
David Geismar
  • 3,152
  • 6
  • 41
  • 80
3
votes
0 answers

Setup Flask to use *.scss - with Flask-Assets and PyScss

I can't get Flask to work with scss. I looked into this Using sass with Flask and jinja2 and Set up Flask with webassets. But I am currently stuck. I setup everything and when running the server with flask run the server starts without errors. When…
Visores
  • 4,008
  • 4
  • 18
  • 29
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 or Bundles are not resovling the correct URL when multiple Blueprints are used

I'm having an issue that I really hope someone can keep me from banging my head against the table about. I have a Flask app with multiple Blueprints that each have their own static and templates directories. When only one Blueprint is registered…
jon333
  • 821
  • 2
  • 16
  • 28
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
1 answer

Flask-Asset does not create correct url on template

I cannot figure out why Flask-CDN is not building my templates with the Amazon CloudFront url for my static files. Here is my setup: 1) Configure cdn domain and ask Flask-Assets to use cdn: class AppConfig(BaseConfig): DEBUG = False …
Daniel Silva
  • 379
  • 1
  • 11
3
votes
2 answers

How can I make Flask-Assets regenerate SCSS every request when debug mode is enabled?

Here is how I set up flask-assets for scss: def configure_extensions(app): # Web Assets from app.extensions import assets scss = Bundle( 'scss/all.scss', filters='scss', output='scss_all.css' ) assets.register('scss_all',…
corvid
  • 10,733
  • 11
  • 61
  • 130
2
votes
0 answers

SASS - compiling using pyscss removes square brackets

I'm working on a web app developed in flask. It uses SASS which we are compiling and Bundling using the flask_assets library with the following code. from flask_assets import Environment, Bundle scss = Bundle('sass/main.scss', filters='pyscss',…
anj28
  • 51
  • 6
1
2 3 4