Repository navigation
Update to documentation - #5
Conversation
bumped in-code version number
sounds like a bug in vite. is there a github issue? |
|
I haven't seen one, but I will look. It is peculiar that vite fails to resolve the .wasm in dev-mode, but puts it in the right place during build. I don't know what they expect to be done for a situation like this. Disabling vite's dev-mode caching for this package works because vite refers to it in-place instead of moving it to the vite cache (it is a relative URL to the .js file that looks up the .wasm file). |
|
I think this is it. vitejs/vite#8427 |
|
so vite has been broken for 3 years 0__o does this work with rollup? this should be mentioned in readme // following is required for web-tree-sitter.wasm to appear in dev-mode
optimizeDeps: { exclude: ["web-tree-sitter"] }, |
|
Vite's position seems to be 'wontfix' until they finish their giant migration to the rolldown backend (which is years late at this point, and hilariously has the same bug vitejs/rolldown-vite#362 ). We seem to be in agreement that this should be in the documentation, so I'll merge this PR if you do agree. |
i mean, the vite issue should be linked in readme |
|
I understand. I'll add that momentarily. |
|
new text // following is required for web-tree-sitter.wasm to appear in dev-mode
// until https://github.com/vitejs/vite/issues/8427 is addressed
optimizeDeps: { exclude: ["web-tree-sitter"] }, |
|
thx can you please also add this to |
web-tree-sitterafter0.26has changed both it's helper wasm filename, and tweaked how it is notified to javascript that is more bundler-friendly than before. As a result of this, our previous bundler-helper code that servedtree-sitter.wasmto the bundle if it was noticed in the project (now renamed toweb-tree-sitter.wasm) was both broken and finally unneeded.The seemingly correct way to handle
web-tree-sitternow is to allow it to bundle on it's own (vite build sees it and picks it up automatically), and accept that while it still doesn't serve properly in vite's dev mode, this can be overcome with a vite settings addition:This tells vite to disable it's internal caching of that particular package, which enables the
.wasmto be found by code running in dev-mode. I don't believe this impacts production builds at all.This PR does not include any code changes (other than version bumps), this merely adds this setting to the example documentation in the README.