Gradle/npm command to generate vite.generated


I am adding storybooks to our project and to build it Vite requires the file vite.generated.ts to be there. I was trying multiple Gradle goals here to generate that file, but apparently it is only generated when I run the development mode. Even when I compile with the production command it does not generate it.

Thanks for your time.

Why aren’t you persisting it to your git repository?

Good question,

by default, in the generated project it is in gitignore. If there are no constraints, I could indeed do it.

I don’t think you can commit it because it also depends on generated files in the build folder.

I see on top of the file the following comment:

[11:25] Thiago Vidigal

  * NOTICE: this is an auto-generated file 
  * This file has been generated by the `flow:prepare-frontend` maven goal. 
  * This file will be overwritten on every run. Any custom changes should be made to vite.config.ts 

But when I run the gradle equivalent ./gradlew vaadinPrepareFrontend it does not get generated.

Mine is committed since day 1; the only time it changes is when I update vaadin.

For the storybooks pipeline we ended up just deleting the vite.config.ts. If we need something there in the future, we might create a specific one.

Committing just the generated file would not be enough, given the dependencies it has on the build folder.