Problem Overriding the Generated Service Worker

I have a no spring vaadin application (last releas 24.6.0)
I’m trying to override the service worker with a my own sw.ts file as suggested in the documentation.
The sw.js file is produced, but during deployment the original sw.js file is always regenerated.
I find always in the directory target\dev-bundle\webapp

Does anyone know how to solve it?
I tried everything, even putting my sw.js file under frontend or under src/main/webapp or under resources/META-INF/VAADIN/resoruces, basically everywhere, but nothing…