Hy, I'm working with Play! Framework 2.5.13
I try to build a webpage with different web-modules (html + scss + CoffeeScript).
Now I want reuse this web modules multiple time on the same webpage.
Each module includes his css and js at the top of the file like following code line:
<link rel="stylesheet" media="screen" href='@routes.Assets.versioned("stylesheets/led.css")'>
But now on each reusing of the modul, the assets (css + js) will be inculded again and blow up the code (duplicate).
I started to move all include-commands from the module in the main.scala.html file, but this doesn't feel really nice, cause the modules will be loaded dynamic.
So how can I use a module (html + css + js) multiple time but loading the assets (css, js, img) only once?
What's the recommanded way to reuse assets on same page?
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b56e8e0d-9d6b-425b-8b0f-609cd8d426cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<link rel = "stylesheet" media = "screen" href ='@routes.Assets.versioniert("Stylesheets/led.css")'>
<script src='@routes.Assets.versioned("javascripts/led.js")' type="text/javascript"></script>
@for(nr <- numbers.reverse) {
@led()
}
This sounds a bit like https://github.com/playframework/playframework/issues/5242 or https://github.com/playframework/playframework/issues/5765There are workarounds for both -- can you try them and see if it helps?
On Thu, Jun 22, 2017 at 11:26 PM, Joel Geiser <joelg...@gmail.com> wrote:
Hy, I'm working with Play! Framework 2.5.13
I try to build a webpage with different web-modules (html + scss + CoffeeScript).
Now I want reuse this web modules multiple time on the same webpage. Each module includes his css and js at the top of the file like following code line:
<link rel="stylesheet" media="screen" href='@routes.Assets.versioned("stylesheets/led.css")'>But now on each reusing of the modul, the assets (css + js) will be inculded again and blow up the code (duplicate).
I started to move all include-commands from the module in the main.scala.html file, but this doesn't feel really nice, cause the modules will be loaded dynamic.
So how can I use a module (html + css + js) multiple time but loading the assets (css, js, img) only once?
What's the recommanded way to reuse assets on same page?
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/118ada1e-69de-4943-928b-9e013cd700eb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAE5q7xph%3DLia0Ot7VC0S%2BeaCYoPf9hF0-PMuw6VQGB4JnmNfXw%40mail.gmail.com.