With gradle task flowCopyFrontendResources
as registered in webapp/build.gradle.kts, the following steps bring a working productionMode:
./gradlew clean
./gradlew webapp:vaadinBuildFrontend
- run main method in WebApp.kt
Without gradle task flowCopyFrontendResources
, there's one of the following two cases:
./gradlew clean
just to be sure; now webapp/build is non-existent- Make sure
webapp/build.gradle.kts
hasvaadin { productionMode = true }
./gradlew webapp:vaadinPrepareFrontend
, then observe the following:webapp/build/flow-frontend/styles
only containsmybutton.css
but notmytextfield.scss
webapp/build/resources
is non-existent
./gradlew webapp:vaadinBuildFrontend
fails due toFailed to find the following css files in the
node_modules
or/Users/manuel/Repos/multiprojectgradletest/webapp/frontend
directory tree: - ./styles/mytextfield.scss
./gradlew clean
- Make sure
webapp/build.gradle.kts
hasvaadin { productionMode = false }
- run WebApp to initiate building the frontend, then observe the following:
build/flow-frontend/styles
containsmybutton.css
andmytextfield.scss
build/resources
only contains theflow-build-info.json
- Make sure
webapp/build.gradle.kts
hasvaadin { productionMode = true }
- run
gradle webapp:vaadinBuildFrontend
and observe:build/resources
now contains some more files
- (re)run WebApp, now the production mode seems to work