-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add VitePress integration #356
Conversation
✅ Deploy Preview for vite-plugin-pwa ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
chore: add var args to integration hook docs: add old vitepress section in frameworks and point any link to 0.12.3 version docs: add new vitepress section
export function createBuildEndHook(userOptions: Partial<VitePWAOptions>): (siteConfig: any) => Promise<void> { | ||
return async (siteConfig: any) => { | ||
// run first integration hook | ||
await userOptions.integrationHook?.(siteConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove that, ppl can do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antfu Finally I have left this option included
plugins: [VitePWA(userOptions)], | ||
}, | ||
'build', | ||
'production', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these 2 options be configurable?
Can't we await Vite 3.1 for the object hook? I am still not a fan of having integration-specific logic built in. |
We need to do this way for SvelteKit and VitePress, both repos reject the integration. For VitePress there is no race condition we only need to use the build end hook For SvelteKit we need both, the integration and the sequential hook. An alternative can be split the repo similar to UnoCSS with separate integrations. |
@@ -227,6 +308,7 @@ function prepareSidebar(idx: number) { | |||
const ogUrl = 'https://vite-plugin-pwa.netlify.app/' | |||
const ogImage = 'https://vite-plugin-pwa.netlify.app/og-image.png' | |||
|
|||
// @ts-expect-error avoid TS2321: Excessive stack depth comparing types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to remove this line, it seems on IntelliJ is not working but it works in VSCode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this error seems to appear and dissapear randomly, so we can keep it: https://discord.com/channels/325477692906536972/1012326745753530419/1012347386653319248
included in the integration repo |
I need to change the docs
closes #355