React.js JSX files import

315 views
Skip to first unread message

mmary...@gmail.com

unread,
Jan 18, 2017, 11:01:19 PM1/18/17
to Play Framework
I am using sbt-reactjs to compile JSX files used by react.js framework. Well I started using. 
However now I wanted to integrate i18n into JSX file so I added at begging:

import i18n from "i18n";

but I am getting compilation error:

play.sbt.PlayExceptions$CompilationException: Compilation error[Parse Error: Line 1: Illegal import declaration]

All guide/examples I found are either using npm and not webjars and babel for compilation.
And all guides I found for using react.js with play framework were short only having 2 components in one jsx file.

Can anyone point me what would be best way to use react.js with play-framework?

Greg Methvin

unread,
Jan 18, 2017, 11:35:54 PM1/18/17
to play-framework
It doesn't seem like sbt-reactjs will handle import statements: https://github.com/dispalt/sbt-reactjs/issues/17#issuecomment-112879695

You could probably do it with sbt-babel, since babel can transpile JSX.

--
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/b82ffe92-5410-44e6-8122-de8e33a79930%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

Reply all
Reply to author
Forward
0 new messages