-
-
Notifications
You must be signed in to change notification settings - Fork 11
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 specify the output for all generated assets? #32
Comments
It is hacky but you can use relative paths: check #15 (comment) and the final comment in previous issue: assetName: (type: AssetType, size: ResolvedAssetSize) => {
return `icons/favicons/${defaultAssetName(type, size)}`;
}, |
First of All, Thanks for your help <( ̄︶ ̄)> |
By the way just as a side note, I think the generator is a bit out of date, here's what headers it recommended: But here's the output of the generator: <link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/logo.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png"> I think the output should be: <link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/logo.svg" sizes="any" type="image/svg+xml"> Isn't that right? |
Yes. Icons generation and markup not related: icons will be generated using the preset and the markup using To generate proper html markup, you need to add custom config file, I'm going to add headLinkOptions: {
preset: '2023'
}, |
Ah perfect thanks! |
It would make more sense to give the possibility of choosing a preset from the preset field directly, e.g. import {defineConfig} from '@vite-pwa/assets-generator';
defineConfig({
preset: 'minimal2023',
...
}) So this value can easily be used in cli module to switch favicon preset as well. |
@vdegenne released You can use from command line this way: pwa-assets-generator --preset minimal-2023 --html.preset 2023 public/favicon.svg |
@userquin Excellent! I can finally remove my config file and rely on this only command, |
Thanks for this plugin, I like it.
Recently I've changed the way I build my assets,
Previously my
logo.svg
was inpublic
where I usedpwa-assets-generator
to generate the assets from. It worked well but I want to be able able to inline mylogo.svg
in my app, because it's in the public directory Vite refuses to inline it.So what I did was to move the logo to
src/assets/img/
where I have my other assets that I can import in my app with the?inline
helper (I'd rather inline the svg that is small than create an unnecessary http request.)Unfortunately I can't find any option in
defineConfig
that would let me output the generated assets in another location so all assets are generated undersrc/assets/img
which is not great because they won't be made public.Why isn't there an option to specify the output location?
One work-around I can think of is to simply copy the svg to the public directly:
But I don't know it feels hacky..
The text was updated successfully, but these errors were encountered: