We are using vaadin 24.6.0. We have a spring boot microservice that has an existing frontend/src folder which contains frontend code developed using plain web components.
We are introducing vaadin in this application hence I wanted to keep the vaadin files separately. I have added the below tags to the
The new folder vaadin-frontend does get created on execution of the maven command but the build still compiles files from the existing frontend folder which should be skipped.
How do I tell vaadin build to not compile or parse the existing frontend folder?
Vaadin looks up for ${project.basedir}/src/main/frontend folder by default and fallbacks to ${project.basedir}/frontend if the former isn’t found.
And basically in your case it eventually finds the ${project.basedir}/frontend folder and doesn’t use the frontendDirectory path, because the vaadin-frontend folder doesn’t exist (having frontend folder takes precedence over parameter, because custom named folder is not found).
You need to create vaadin-frontend folder manually then these properties should work.
I just tested with Vaadin 24.6.2:
moved ${project.basedir}/src/main/frontend to ${project.basedir}/ (it had theme files and some placeholder files).
Thanks for the response @mikhail.21 but surprisingly it didn’t work. I did create the vaadin-frontend folder before running the maven command but I still get the errors The command is mvn -B -DskipTests=true clean vaadin:build-frontend -Pproduction package -DCVESCORE=11 -DBUILDNUMBER=1
A couple of errors are - these indicate that vaadin is still looking into the frontend folder. Note the frontend folder is in the root directory.
[ERROR] frontend/src/router/routes.ts(169,18): error TS7006: Parameter 'context' implicitly has an 'any' type.
[ERROR] frontend/src/router/routes.ts(174,18): error TS7006: Parameter 'context' implicitly has an 'any' type.
One difference I noticed was I do not have the prepare-frontend goal defined for the vaadin-maven-plugin. I have the build-frontend goal defined for the flow-maven-plugin. It is part of the profiles` as shown below
I just tested with running build-frontend and it gave me no errors, but I have no TypeScript sources in my ./frontend/src folder. Could you please check where the generated folder is created, in the ./vaadin-frontend or in ./frontend folder? I.e. I need to know which one is picked by Vaadin. Because the TS errors above might be produced by TS compilation running by something else than Vaadin.