playframework - How to reference exported assets in a multi-module play project -


I have a multi-module play framework project with two modules, normal which is a standard project It's playable with reusable codes and assets, and the app that I'm trying to run. By using the SBT-Web plugin, I can create and modify assets in the normal / src / main / public folder which is the folder app / target / web / web-modules / main / web browsers Every time the app reloads / libs / normal my problem is that these assets are referred to in my play view. My route file contains lines

  received / property / * file controller.asset.et (path = "/ public", file) GET / webjars / * File controller. WebJarAssets.at (file)  

and in my index.scala.html file app by example

< Pre> & lt; Link rel = "stylesheet" media = "screen" href = "@Raarg.search.orgSets. (WebAssets.Letate (" General / CSS / Directive CSS "))

This file exists at the app / target / web / web-module / main / webabs / lib / common / css / directives.css , but WebJarAssts.locate returns

  {"status": {"errors": [{"message": "General / CSS / Directives. CSS could not be found. Make sure that you have added this web browser and please check the typo. "}]}}  

I have tried to specify the path less and also assets. , but no luck Also know the way to properly export the exportable property?

There are relevant lines from my build.sbt file

  Val playVersion = play.core.PlayVersion.current Lazy Val General = Project.Anneal Plugin (SBTWeb, SBTTWL). Settings (LibraryDrinkies ++ = Seek ("Com. Playing "%%" play "% Players%" "), sluggish Val app = project.nonplugin (pljeva). Settings (LibraryDePresence ++ = Seek (" Org. Webbers "%%" Web- Play "%" 2.3.0 ")) .Dependon (normal%" compile->; compiled; test-> test ") Slowly Val Suite = Project. (File (". "). Total (General, App )  

I believe that I have exported I have found the proper way to use the property I was on the wrong track, along with treating them as webbars in my play views; Something was wrong for me in this regard:

Assets are exported in WebMara format and imported in the same way as other Webmember dependencies.

It has been found that the exported property is available in two places, (1) in app / target / web / web-module / main / webabs / lib / general as described in my question and (2) in app / target / web / public / main / liberalization / general . I was not able to reach the pre-usage using the Web-Play plugin, but can later be accessed as a simple asset eg

  & lt; Link rel = "stylesheet" media = "screen" href = "@ routes.asets.at (" lib / common / css / directives.css ")" & gt;  

As far as I can understand, it will also work in production.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -