0

I have build a react app with some external libraries and would like to include it into an existing project that has nothing put JSP's.

Running the command react-scripts build generates files in a build folder.

  • build/asset-manifest.json
  • build/favicon.ico
  • build/index.html
  • build/manifest.json
  • build/precache-manifest.23802519359aee1ffa0ec2f3ba332c80.js
  • build/work.js
  • build/static
  • build/tab.png

What do I include and how do I include these files.

I have tried to add the index.html into index.jsp but is doesnt seem to work. Although I do see the title change to what is in my react app.

<%@include file="index.html"%>

or do I need to include all the files similar to how I added index.html

The index.html file does load a couple of script files in the build/js folder like so below.

<script src="/static/js/2.57fa75d6.chunk.js"></script><script src="/static/js/main.fe75a1b9.chunk.js"></script>

user3126529
  • 399
  • 1
  • 3
  • 12

1 Answers1

0

I have project with similar requirements as yours. Some info needs to be render at server, but could not find proper way to do it in java, so I created maven plugin for that:

https://github.com/maasdi/react-assets-maven-plugin

You can try check it out, hope that can help with yours.

Maaz
  • 1
  • 2