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
2
votes
0 answers

How to compile multiple less files into multiple corresponding css files using webassets

I have the following Bundle configuration: less = Bundle('**/*.less', filters='less', output='static/less.%(version)s.css') Is it possible to compile the different less files into corresponding css files (in debug mode)? This…
Litzi
  • 108
  • 7
2
votes
2 answers

Using "depends" in webassets bundles

I'm using webassets in my Flask application using Flask-Assets and I'm having trouble with the depends option when creating bundles. In my case I'm bundling LESS files from the following directory structure: /static \_ /css \_ /bootstrap …
oddurad
  • 417
  • 1
  • 4
  • 14
2
votes
1 answer

GAE: Flask/webassets throws an expection on {% extends "base.html" %}

I am trying to port my existing flask app into google app engine. After a lot of reading and solving issues, I came across a problem I am completely stuck with: Upon starting the app on my local environment, I get this error message: Short…
Houman
  • 64,245
  • 87
  • 278
  • 460
1
vote
1 answer

webassets + jinja2 bundle error

I am trying to define a Bundle on the fly in a template file using webassets package for python and jinja2 however I keep getting errors: BundleError: '/docroot/static/css/base.css' does not exist {% assets filters='cssutils,gzip',…
BillPull
  • 6,853
  • 15
  • 60
  • 99
1
vote
1 answer

How to remove older css files after webassets rebuilds the scss for a python flask app?

I have a Python 3.9 flask app which uses the flask_assets library. My flask init.py file looks like: import logging import os from flask import Flask, request, current_app from config import Config from flask_assets import Environment from…
Aivoric
  • 838
  • 2
  • 10
  • 24
1
vote
2 answers

Writing custom filter in flask-assets (webassets)

Using Flask with flask-assets (from webassets) I wrote my own custom filter for a css compressor, following the documentation. It doesn't seem to work: from csscompressor import compress from flask_assets import Bundle from webassets.filter import…
Christian Macht
  • 456
  • 4
  • 20
1
vote
1 answer

How to pass filter specific configuration options in webassets

Using flask, flask-assets, webassets I am trying to pass a filter specific configuration for a particular filter in webassets, but haven't been able to do so, so far. Have read the documentation multiple times to no avail. Have also gone through the…
bool.dev
  • 17,508
  • 5
  • 69
  • 93
1
vote
1 answer

Flask-Assets working locally but not on Heroku

I'm working to modify a cookiecutter Flask app. I'm working locally on WIN7 and attempting to deploy to heroku. I'm currently trying to add a datepicker to a page. I've found https://eonasdan.github.io/bootstrap-datetimepicker/. The structure of…
user1592380
  • 34,265
  • 92
  • 284
  • 515
1
vote
1 answer

How to use Flask assets to set cache for static files

I used Flask assets in my project to combine all js and css files. Its working perfectly. assets = Environment(app) js = Bundle('js/jquery/jquery.js','js/owl.carousel.min.js',output='gen/packed.js') assets.register('js_all', js) css =…
Tyler Durden
  • 93
  • 3
  • 9
1
vote
1 answer

jason lewis basset did not show icons well in laravel 4

I have a problem with rendering css+html of the bootstrap theme in laravel 4. I by a admin template, and web browser show me something like that . I use jasonlewis basset to generate admin template. How to fix this? I use this in…
mrakodol
  • 1,143
  • 3
  • 12
  • 41
1
vote
1 answer

Webassets - exclude file in bundle

I have a directory and want to exclude a few files like Ant does, is this possible with webassets? Or does if bundle could take a list or tuple, which doesn't seem to be the case?
mike clagg
  • 830
  • 7
  • 12
0
votes
0 answers

How to use flask_assets and then inline the bundle's content?

I am familiar with: create the bundle from flask_assets import Bundle bundles = { 'all_css': Bundle( '../dependency1.scss', '../dependency2.scss', filters=("libsass", "rcssmin"), output="css/my.min.css" …
101010
  • 14,866
  • 30
  • 95
  • 172
0
votes
0 answers

Is there a way to copy assets, without consolidating/filtering them using `flask-assets` or `webassets`?

I'm trying to consolidate all the random things we do in our project to make things work. This SO question is about copying image files and fonts from their node_modules source to the right location in our flask application. After a great deal of…
101010
  • 14,866
  • 30
  • 95
  • 172
0
votes
0 answers

webasset not showing updated files

I have a question about webasset. I am using ckan. I updated a library in ckanext_geoview plugin in ckan. But when calling this library with webassets comes the old version. What path can I follow? webassets.yml like this openlayers_js: filter:…
0
votes
1 answer

CKAN 2.9 ValueError: Registry initialized :: ckan basic-charts plugins

I am new to ckan. After successfully installing ckan when I went to use some ckan plugins as an example ckan-basiccharts i am getting ValueError. After some research, I understand it's related to web-assets. In basicchart folder, I change the…