Joaquín Sánchez
Joaquín Sánchez
why `apply: 'serve'`? It shouldn't be called, if Vite 4 calling `buildEnd` it should be a bug (no makes sense having `buildEnd` in a dev plugin).
No, but you can try adding build hooks (https://rollupjs.org/plugin-development/ and https://vitejs.dev/guide/api-plugin#transformindexhtml)... (apply can be also a function)
@bluwy the plugin shouldn't be called in `build`, it has `apply: 'serve'`, check [Conditional Application](https://vitejs.dev/guide/api-plugin.html#conditional-application) EDIT: I think I have misunderstood the issue
It works on first run after build (`pnpm test-serve`), second run fails with same CI errors (node 20.10.0 LTS): 
You're using `base: '/app/'` and you're registering the sw scope with `/`, remove the `scope` from the pwa configuration and update the `start_url` to use the base url or configure...
@leonardo-melhor-envio upps, I have no idea about that configuration, it seems you have 2 urls, try just adding `/` to the pwa scope and `start_url`, add also a `manifestTransform` to...
who is injecting that import and when? The problem is about sw build, try using `injectManifest` if you're using `generateSW` strategy, it seems workbox-build is not able to inline that...
So, the problem is only in dev (?), I'm going to check if registering the sw using type module works. Running build script the sw generated without that import.
Registering the sw using type module, I'll check if we can remove that import: 
try building your app and running the preview script or `npx serve` command in your local