aklinker1 / vite-plugin-web-extension

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

change build.rollupOptions.output.entryFileNames throw entrypoint not found error #92

Open WOSHIZHAZHA120 opened 1 year ago

WOSHIZHAZHA120 commented 1 year ago

Summary

cannot change build.rollupOptions.output.entryFileNames

i saw the code just replace the extension name to match output maybe can use facadeModuleId and isEntry attribute to help identify ?

Reproduction

https://github.com/WOSHIZHAZHA120/5c122de243419b83f4cc5c2a01dd69a2d91c9dd7

Environment


  System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 6.59 GB / 15.75 GB
  Binaries:
    Node: 19.8.1 - ~\scoop\apps\nodejs\current\node.EXE
    Yarn: 1.22.19 - ~\scoop\apps\yarn\current\bin\yarn.CMD
    npm: 9.5.1 - ~\scoop\apps\nodejs\current\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1413.0), Chromium (111.0.1661.41)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vite: ^4.2.0 => 4.2.0
    vite-plugin-web-extension: ^3.0.2 => 3.0.2
aklinker1 commented 1 year ago

I can look into supporting changing the output config, but what reason do you have changing it? It looks like your just trying to obfuscate the files?

The plugin automatically configures the output so it follows all the developer guidelines google puts forth for publishing extensions, so you shouldn't need to configure any output config.

WOSHIZHAZHA120 commented 1 year ago

Yes, I want to obfuscate the files, I'm doing a private extension and want to share it with some people so they can't find the files and code right away.

is this possible ?

aklinker1 commented 1 year ago

Ah I see, that makes sense for a private extension.

I'll look into supporting this. For now, you'll have to write a script that runs after your build that calculates the hashes and renames the files on disk and in the manifest.