Open adenix opened 6 months ago
I have the same issue
+1
Same issue. One workaround would be to place the web accessible content inside a public
directory and update the resources
path accordingly.
Ahh, I see, you're expecting the files to be copied into dist/
for you... Unfortunately the plugin doesn't do this, it probably should, but I'm not adding any more features to this package myself.
I'd recommend putting the files into the public directory if they're assets that don't need to be processed by Vite, or if they do (like shown in the original issue), add the inputs to additonalInputs
to have Vite bundle them.
Hello,
I also need to build ts
files. Sorry I'm new to web extension and vite but where does additonalInputs
come from ? I couldn't find it in vite-plugin-web-extension`'s doc or vite's doc.
I'd recommend putting the files into the public directory if they're assets that don't need to be processed by Vite, or if they do (like shown in the original issue), add the inputs to additonalInputs to have Vite bundle them.
the thing is additionalInputs
only supports file paths and not globs, makes the work harder for files that need to be included in build process, specifying each file manually isn't anywhere a good experience
Unfortunately the plugin doesn't do this, it probably should, but I'm not adding any more features to this package myself.
will there be no further developments in this library, even PRs?
the thing is additionalInputs only supports file paths and not globs, makes the work harder for files that need to be included in build process, specifying each file manually isn't anywhere a good experience
Just do it yourself:
import glob from 'glob'
...
additionalInputs: await glob('/assets/*.png')
will there be no further developments in this library, even PRs?
I don't plan to add any features, no. I'd recommend using WXT instead. I haven't archived this repo or made any public announcements yet because WXT isn't at v1.0 yet, I'm waiting for that. But it's close to v1.
But you're welcome to open PRs, and I will do bug and security fixes, at least for vite 5. Once vite 6 is released, this plugin will likely break, and I don't plan on supporting it after that.
patching it myself isn't an issue, actually i was planning to migrate my existing codebase to a library for a better DX, if its goona go deprecated, i better wait for wxt.dev to be stable, then migrate my codebase to wxt, thanks though
Summary
Including 'web_accessible_resources' in the manifest file does not result in those resources being compiled to the dist folder.
Reproduction
Add a
web_accessible_resources
block to the manifest.json file.Environment