aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
553 stars 48 forks source link

Fix .tsx→.js replacement in manifest.json #33

Closed Treora closed 1 year ago

aklinker1 commented 1 year ago

Thanks for the PR!

aklinker1 commented 1 year ago

https://github.com/aklinker1/vite-plugin-web-extension/releases/tag/v1.4.2

Treora commented 1 year ago

Thanks for merging and releasing so quickly! I now realise this actually was quite a selfish PR, as other extensions like jsx should be added there too; and mjs or others? Vite lists these as default extensions it resolves: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json']. But I guess that e.g. a vue plugin will let you put content_script.vue in the manifest,; perhaps the performed file name mappings can be obtained from vite itself, avodiing the need to hard-code any of them?

aklinker1 commented 1 year ago

No worries. Since these are manifest entry points, they don't need to support all the files that vote does, logically, using a json file as a content file. Other than jsx, I don't see a reason to use one of those other file types in the manifest.

So leaving it as is is fine. If someone wants another type, we can explore using the built-in values then.