django - Dart absolute url for assets. Or serving assets on separate server/folder -
I am creating a Polymer.dart app which uses Django as backend. And I want to put all the static files in the "static /" directory, or for example I want to use the CDN server. But the "Pub build" script creates related URLs for the script and other properties. Is there a way to inject a full prefix for the release of url during "pub build"?
UPD: So simple solution was to create a transformer: There is an open polymer issue to support this An alternative solution is mentioned in the linked discussion: The server
import 'dart: async'; Import 'package: barbeck / barbecue' dart '; Class URL enhances Transformer Transformers (UrlTransformer.asPlugin ()); String is allowed = Extension = & gt; '.html'; Apply to the future (Transformation Transformation) {Return Transform. Primitive input.produststring (). Then ((content) {transform.addOutput (New Asset .from. (Transform. Promi Input.ID, Content. Replace Elmap (New RegXP (R'SRC = "([^ \ {"] +) "'), (match-m ) = & Gt; "src = \" / static / $ {m [1]} \ ""). Replace all ("href = \" ", href but I do not know how the dart2js transformer results in the apropriate folder The results are JS files in the same directory as * .html now. I have to put $ dart2js in the public for my transformer Tried but transformer launches initialization step when errors on
pub build , then I can not create a transformer for that.
[ ... /> package can redirect all requests containing //////
Comments
Post a Comment