JSX files from react.js in Play framework

288 צפיות
מעבר להודעה הראשונה שלא נקראה

Random 123

לא נקראה,
17 בינו׳ 2017, 15:04:1017.1.2017
עד Play Framework
Hello,

 I found only one tutorial how to make work react.js from webjars with auto-precompile jsx files with plugin for sbt-web.
But its not working. What I did was:

added plugin:

addSbtPlugin("com.github.ddispaltro" % "sbt-reactjs" % "0.6.8")

enabled in build.sbt using SbtWeb

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean,SbtWeb)

also have react web jar in libraries:

"org.webjars" % "react" % "15.3.2",

For test I put javascript file into folder
public/javascripts/test/test.jsx

I am using Intellij IDEA for my play project and when I run it or build , there is no test.js file created and when I open page from broswer linked javascript test.js is not found..

What am I doing wrong? Can anyone guide me to some WORKING source code with react.js integrated into play?



Greg Methvin

לא נקראה,
17 בינו׳ 2017, 15:19:1917.1.2017
עד play-framework
Assets that need to be compiled should go in app/assets. Assets that are meant to be served as-is should go in public/. I suspect if you move your file to app/assets/javascripts/test/test.jsx it will work as expected.

--
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/2c77b81b-c399-4922-94be-015e613732b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

השב לכולם
השב למחבר
העבר לנמענים
0 הודעות חדשות