Skip to content
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

Can't I modify the href in the manifest file? #184

Open
devmini1203 opened this issue Feb 5, 2025 · 5 comments
Open

Can't I modify the href in the manifest file? #184

devmini1203 opened this issue Feb 5, 2025 · 5 comments

Comments

@devmini1203
Copy link

devmini1203 commented Feb 5, 2025

The baseUrl on my website is '/gb'
Deploying through nginx.

I installed @vite-pwa/nuxt and created a manifest in the pwa option of nuxt.config.ts.

And I added the component to the app.vue.

If you look at the developer tool on the site you distributed

You can see that it is inserted into the head as shown.

Naturally, the browser is unable to find the manifest file...

I'm going to put it on the head of nuxt.config.ts' app option

When filled in, the manifest file is located well on the distributed site.

When using VitePwaManifest, is there an option that matches the same as baseUrl?

Or is it something I can't find?

I wish I could modify the path of href.

Please help me :[

@devmini1203 devmini1203 changed the title Can't I modify the href path in the manifest file? Can't I modify the href in the manifest file? Feb 5, 2025
@userquin
Copy link
Member

userquin commented Feb 5, 2025

Are you changing the base URL at runtime? Pwa needs base at build time, you can use the base pwa option.

@devmini1203
Copy link
Author

devmini1203 commented Feb 5, 2025

Are you changing the base URL at runtime? Pwa needs base at build time, you can use the base pwa option.

Thank you for your response.
It's written in nuxt.config.ts as follows

app : {
baseURL : process.env.NUXT_PUBLIC_APP_BASE_URL
},

...
...
...

pwa : {
base : '/gb'
}

I tried to apply the solution you gave me, but it still doesn't seem to find it..

If you go to the distributed site and check the head
Still

href="/gbmanifest.webmanifest"

It's written like this.

If you change this directly to href="/gb/manifest.webmanifest" in the developer tool, an installation icon will be created in the address window

What's the problem...

@userquin
Copy link
Member

userquin commented Feb 5, 2025

can you try with base: '/gb/'? Looks like a bug on the vite-plugin-pwa or here...

@userquin
Copy link
Member

userquin commented Feb 5, 2025

Anyway, I'll try to add support for dynamic base url for nuxt via custom client (dev and build)

@devmini1203
Copy link
Author

devmini1203 commented Feb 5, 2025

Anyway, I'll try to add support for dynamic base url for nuxt via custom client (dev and build)

Oh, as you said, base: '/gb' is written
normally in the head of the deployment site

ink rel="manifest" href="/gb/manifest.webmanifest"
It is well inserted into.

Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants