This is a sample JavaFX+react frontend project. The react application is meant to appear in the JavaFX as an iframe.
Run gradlew run
to start the frontend.
The application should appear in a separate window.
Run gradlew build
to:
- Install required npm packages (
npmInstall
). - Build the React application (
npmBuild
). - Copy the React output to the JavaFX resource directory.
- Build the JavaFX application to produce a jar executable in
build/libs
.
- Incremental Build: If no changes are detected in the React working directory, Gradle skips the npm tasks (
npmInstall
andnpmBuild
). - Automation: Ensures the JavaFX project always use the latest React application during the build process.
- React Working Directory: Defined in the
node
configuration ofbuild.gradle
. - JavaFX Resource Path: Defined in the
copyReactBuild
task inbuild.gradle
. Currently configured tosrc/main/resources/webapp
.