vite-pwa / vitepress

Zero-config PWA Plugin for VitePress
https://vite-pwa-org.netlify.app/frameworks/vitepress
MIT License
36 stars 2 forks source link

fix: use module augmentation instead of extending config #9

Closed brc-dd closed 1 year ago

brc-dd commented 1 year ago

also changes defineConfig to withPwa

userquin commented 1 year ago

@brc-dd vitepress-alpha15 seems to break the pwa: the viteConfig.build.ssr is true inside the transformHead hook, we're getting the api reference from the client build, but it seems to be mutated (shared between Vitepress builds?)

Just forgot it, the hook is always called on SSR: I will change the api to just expose the pwa info with a few more flags

userquin commented 1 year ago

You can merge this PR when you solve the ts problem.

userquin commented 1 year ago

@brc-dd you can check how Vitest do the augmentation here: https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/config.ts#L3