rna icon indicating copy to clipboard operation
rna copied to clipboard

Optional icon generator by `generateIcons` option

Open jlsalvador opened this issue 1 year ago • 6 comments

The reason for this commit is that I use another custom generator for favicons (it generates PNGs from an SVG with a custom filename). Because of this, when esbuild-plugin-html tries to load the favicons referred URLs, it fails with the following error:

✘ [ERROR] Failed to resolve icon path: assets/icon-dark-196x196.png [plugin html]

✘ [ERROR] Failed to resolve icon path: assets/icon-dark-196x196.png [plugin html]

[build][resources][manifests]: 25.672ms
Error: Build failed with 2 errors:
error: Failed to resolve icon path: assets/icon-dark-196x196.png
error: Failed to resolve icon path: assets/icon-dark-196x196.png
    at failureErrorWithLog (node_modules/esbuild/lib/main.js:1472:15)
    at node_modules/esbuild/lib/main.js:945:25
    at node_modules/esbuild/lib/main.js:1353:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}
[build]: 30.824ms
[build][resources][assets]: 38.637ms

Therefore, to ignore these errors, I added the build option generateIcons as a flag for the collectIcons.

The default value is true, so its behavior will be the same as always.

I added a test for generateIcons set to false.

jlsalvador avatar Jul 09 '24 20:07 jlsalvador

🦋 Changeset detected

Latest commit: bbc61955fd746f4753eedf4f4de962831bc9d312

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chialab/esbuild-plugin-html Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jul 09 '24 20:07 changeset-bot[bot]

Hello,

Is there anything I can do to help you accept or review this PR?

Greetings.

jlsalvador avatar Jul 22 '24 19:07 jlsalvador

Hello @jlsalvador! Sorry for the late reply. If you are still interested in pursuing this PR, could you please rebase and add the same option for the collectScreens method as well?

edoardocavazza avatar Nov 05 '24 09:11 edoardocavazza

Changes from V1 to V2:

  • Rebased from main.
  • Renamed generateIcons to generateFavicons.

Hello @jlsalvador! Sorry for the late reply. If you are still interested in pursuing this PR, could you please rebase and add the same option for the collectScreens method as well?

@edoardocavazza I think for collectScreens could be another option. For example, I might not want to generate the favicons but still need the Apple launcher icons. What do you think?

jlsalvador avatar Nov 08 '24 08:11 jlsalvador

I agree!

edoardocavazza avatar Nov 08 '24 08:11 edoardocavazza

Hi again! Anything left to accept this PR? I thought about collectScreens would be another PR.

jlsalvador avatar Dec 12 '24 08:12 jlsalvador