-
-
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
add outdir option per image proposal #15
Comments
To add for the record: I thought that adding a relative path to the |
Uhmm, you can provide the favicon names with the relative paths, if using defaults the corresponding names will be plain names. You can override favicons with relative paths: export const minimalPreset: Preset = {
transparent: {
sizes: [64, 192, 512],
favicons: [[64, '../../../public/favicon.ico']], // <== this one: by default [[64, 'favicon.ico']],
},
maskable: {
sizes: [512],
},
apple: {
sizes: [180],
},
} |
Ahh, you're totally right, that's the way to go in this case ;) appreciate your help |
if you need the path change for all the generated assets, add an import { AssetType, ResolvedAssetSize, defaultAssetName, defineConfig } from '@vite-pwa/assets-generator/config';
export default defineConfig({
preset: {
transparent: {
sizes: [64, 192, 512],
favicons: [[64, 'icons/favicons/favicon.ico']],
},
maskable: {
sizes: [512],
},
apple: {
sizes: [180],
},
assetName: (type: AssetType, size: ResolvedAssetSize) => {
return `icons/favicons/${defaultAssetName(type, size)}`;
},
},
images: ['public/logo.svg'],
}); |
Hello all, Regards, |
This worked for me. Thanks @benkroeger |
This isn't working for me :(
The manifest.webmanifest is created with the correct path for the icons but the assets isn't generated and the dist/icons/favicons/ folder isn't created. I'm using:
Any suggestion? |
By default the pwa assets will be generated in the image source folder, you can use a
assetsName
callback to change the output dir to create the assets in subfolders or in another path (via relative path using..
).Since the pwa assets will use
node path resolve
with the image source folder, we can add a new option (optional) and resolve the asset against the new option or the image folder.Hint:
We need to change the
images
signature to (and the usage from the cli-start module):https://github.com/vite-pwa/assets-generator/blob/main/src/build.ts#L39 will be:
From this comment #13 (comment)
The text was updated successfully, but these errors were encountered: