This example project demonstrates integrating Grails and React apps using Vite. It uses
Grails version: 5.3.3 profile: web
JVM version: 1.8.0_392
Gradle version: 7.2
Groovy version: 3.0.8
Node Grade Plugin version: 7.0.2
Node version: 18.17.1
Vite version: 5.0.8 template: react
React version: 18.2.0
Clone this repository.
Open terminal in project root, and enter
sdk env install
./gradlew bootRun
Open another terminal in project root, and enter
sdk env install
./gradlew dev
In a browser navigate to localhost:8080/grailsvitereact
.
To create a war file for deployment, enter
./gradlew assemble
Find the war file in build/libs/grailsvitereact.war
. Run the war by entering
java -jar build/libs/grailsvitereact.war
- Grails documentation
- Grails Asset-Pipeline documentation especially see configuration
- Groovy Server Pages documentation, especially the if tag
- Gradle documentation
- Node Gradle Plugin repository
- Vite guide, especially see backend intergeration, plugin ordering documentation
- Rollup tutorial, especially see using configuration for input and out-entry file naming
- Rollup Image Plugin repository
- SDK Man site to install and use
- Finally the React documentation