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

feat: allow use of full url for pwa manifest and icons #4736

Merged
merged 1 commit into from
Nov 12, 2019
Merged

feat: allow use of full url for pwa manifest and icons #4736

merged 1 commit into from
Nov 12, 2019

Conversation

tkint
Copy link
Contributor

@tkint tkint commented Oct 21, 2019

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

This PR allows use of pwa.manifestPath: 'https://other-domain.com/manifest.json' and makes more sense when using pwa.manifestCrossorigin: true.

I added support of full url for icons too, because it's the same way of building links.

@haoqunjiang
Copy link
Member

Could you provide a practical use case for this feature, please?
I thought it makes more sense to provide a full URL for publicPath in this case.

@tkint
Copy link
Contributor Author

tkint commented Nov 9, 2019

Could you provide a practical use case for this feature, please?
I thought it makes more sense to provide a full URL for publicPath in this case.

If you do that, then all of your ressources must come from this same publicPath.

In my case, I want icons to be relative to the publicPath "/", but I want my manifest to come from a REST API with a full URL:

pwa: {
  name: 'My App',
  themeColor: '#FF6622',
  msTileColor: '#FF6622',
  favicon32: 'img/icons/favicon-32x32.png',
  manifestPath: 'https://my-api/getManifest',
  appleMobileWebAppCapable: 'yes',
  workboxOptions: {
    skipWaiting: true,
    clientsClaim: true,
    exclude: [/\.htaccess/],
  },
},

If I do that right now, I will get that in my index.html:

<link rel=manifest href=/https://my-api/getManifest>

And of course, the link is not valid.

@haoqunjiang
Copy link
Member

Yeah that makes sense.

@haoqunjiang haoqunjiang merged commit 6c4a0bf into vuejs:dev Nov 12, 2019
@vue-bot
Copy link

vue-bot commented Nov 12, 2019

Hey @tkint, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

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

Successfully merging this pull request may close these issues.

3 participants