Skip to content

Commit bb8db30

Browse files
fix: fix pwa icons being removed (#589)
1 parent e8c0454 commit bb8db30

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/platforms/pwa/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ export class PwaAssetGenerator extends AssetGenerator {
143143
const destDir = join(pwaAssetDir, PWA_ASSET_PATH);
144144
try {
145145
await mkdirp(destDir);
146-
} catch {
146+
} catch (e) {
147+
console.log(e);
147148
// ignore error
148149
}
149150

@@ -364,7 +365,9 @@ export class PwaAssetGenerator extends AssetGenerator {
364365
// Delete icons that were replaced
365366
for (const icon of icons) {
366367
if (await pathExists(join(pwaDir, icon.src))) {
367-
const exists = !!pwaAssets.find((i: any) => i.sizes === icon.sizes);
368+
const exists = !!pwaAssets.find(({ template: { width, height } }) => {
369+
return `${width}x${height}` === icon.sizes
370+
});
368371
if (!exists) {
369372
rmSync(join(pwaDir, icon.src));
370373
warn(`DELETE ${icon.src}`);

0 commit comments

Comments
 (0)