[Feature Request]: postgres.wasm
, postgres.data
, extension.tar.gz
asset paths (Chrome Extension Use Case)
#426
Labels
postgres.wasm
, postgres.data
, extension.tar.gz
asset paths (Chrome Extension Use Case)
#426
Currently, Pglite does not provide a neat mechanism (or if it does, it is not well documented) to properly handle serving wasm or the tar.gz assets when building a Chrome extension. I encounter fetch errors because the required files are not found in the desired paths unless manually configured.
Given this:
To ensure the files are accessible, I need to use the following viteStaticCopy configuration:
The worker importing the assets is present at
./assets/worker.js
.This workaround helps in making the necessary files available in the desired output paths, but it feels cumbersome and not as clean as it could be.
Suggestion:
An approach similar to what is used by web-tree-sitter may improve developer experience. The library solves for similar issues using a locateFile function, as documented here.
I am then able to do:
Would it be possible to either provide a built-in mechanism within Pglite to handle asset serving more cleanly or to document an approach that integrates better with bundlers such as Vite for building Chrome extensions?
The text was updated successfully, but these errors were encountered: