-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Feature request: Add SolidStart support #465
Comments
I guess we don't need to include a new package to include only these 2 features, we have a solidjs virtual module and a new virtual module for pwa info that we can use to expose the About sw registration, use About web manifest, you can use a simple tsx component using /// <reference types="vite-plugin-pwa/info" />
import { Link } from "solid-start"; // if missing, just use html <link> tag
import { pwaInfo } from 'virtual:pwa-info';
export function VitePwaManifest() {
if (pwaInfo) {
const { webManifest } = pwaInfo;
if (webManifest) {
const { href, useCredentials } = webManifest
return (
<>
{ useCredentials
? <Link rel="manifest" href={href} crossorigin="use-credentials" />
: <Link rel="manifest" href={href} />
}
<>
)
}
}
return null;
} |
@seeplusplus I can upload a repository to my account and see what it comes up with, then it's a nuance to transfer it here. |
@userquin Thanks for the help! These suggestions work perfectly! Everything is in this repo, https://github.com/seeplusplus/solid-start-vite-pwa but it's basically as you said, I just added the I opened #468 in case anyone else finds themselves similarly looking to get started using this project with SolidStart. |
@seeplusplus I can't get your repo (https://github.com/seeplusplus/solid-start-vite-pwa) working. After
And after stopping the server, the web page doesn't work offline. |
I'm not sure how difficult this would be to add, but I've already used this plugin with a SolidStart project. Everything seems to work perfectly, except for injecting the SW registration script/manifest link (if I add them manually into the root.tsx everything works). I am also more than happy to take a look at adding this support myself, but may take me a bit longer to learn the code.
The text was updated successfully, but these errors were encountered: