You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using webassets, as part of a platform on Flask (CKAN) (so as built-in of Flask? I don't know).
I have a plugin that uses a js library, that uses some css themes, that are initially located relatively to each other:
js.js
js-themes/
default/
icons.png
style.css
style.css references url(icons.png).
Using webassets to bundle style.css, just adding cssrewrite as a filter without config fails with a ValueError in query_url_mapping: "'Cannot determine url for %s' % filepath".
I see in the docs, get_filter('cssrewrite', replace={'old_directory':'/custom/path/'}) replace looks like what I need.
I see there is the documentation for adding a config section to a YAML (if I interpret correctly):
So, I assume, now that I'm looking at it again a 2nd time, cssrewrite simply accepts no config from the environment.
The "manual mode" is the expectation for use.
If so, then I'd like to lobby for enabling "replace" as a config for cssrewrite, especially via YAML (presumably an option can be set via YAML by default, if environment.config can be set). For the platform I'm working with, I'm not sure they provide a means to hook into webassets before/after it runs, aside from simply setting up the YAML config. And I always dislike setting up custom hacks to make things work outside the regular flow.
Anyway, thank you for the consideration.
Also, now that I've had the presence of mind to find the environment config docs, I suppose the YAML might look more like this?
If I can't specify to simply add a prefix where there is none, and must use the regex replace, that would be helpful to elaborate in the docs. Thank you, again.
I'm using webassets, as part of a platform on Flask (CKAN) (so as built-in of Flask? I don't know).
I have a plugin that uses a js library, that uses some css themes, that are initially located relatively to each other:
js.js
js-themes/
default/
icons.png
style.css
style.css references url(icons.png).
Using webassets to bundle style.css, just adding cssrewrite as a filter without config fails with a ValueError in query_url_mapping: "'Cannot determine url for %s' % filepath".
I see in the docs,
get_filter('cssrewrite', replace={'old_directory':'/custom/path/'})
replace
looks like what I need.I see there is the documentation for adding a config section to a YAML (if I interpret correctly):
So, what should cssrewrite config look like via YAML?
Variations on the following stabs-in-the-dark don't work or cause crashes parsing the YAML:
The text was updated successfully, but these errors were encountered: