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:

  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.  

There is an open polymer issue to support this

An alternative solution is mentioned in the linked discussion:

The server [ ... /> package can redirect all requests containing //////

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -