This plugin for vite streamlines the process of developing and bundling a tree-sitter grammar in your project.
Hosted on jsr. Installation instructions for supported platforms are described there.
0.3.12026-01-19 : updated documentation and examples0.3.02026-01-17 : upgraded dependencies- removed special handling for web-tree-sitter (0.26 no longer requires it)
0.2.102025-06-21 : added CLI mode to node implementation0.2.92025-05-27 : adding interactive CLI mode (tree-sitter > 0.25)0.2.82025-01-15 : correctingnodesupport for production mode output0.2.72024-12-27 : updated documentation and examples0.2.62024-12-27 : replaced indirection forcreateReadStreamdue to strangevitebehavior0.2.52024-12-26 : modified some internal path tracking to absolute to remove ambiguity0.2.42024-12-26 : added fs method discriminators- currently supporting
denoandnode - added TRACE log level for better narrowing of issues
- currently supporting
0.2.32024-12-25 : replaced most node behaviors with nativedeno0.2.22024-12-25 : added support for legacy grammar definitions- attempt is made to upgrade a grammar before giving up
- added
pnpmexample usage
0.2.12024-12-24 : cleanup forjsrpublish- added
denoexample - corrected error with detection of
tree-sitter-clitool location - added type documentation
- added
0.2.02024-12-24 : major refactor- use
tree-sitter-cliinstead of replicating it's behavior locally - project converted to
deno
- use
0.1.32024-11-10 : updatedemccflags in compilation step- added option to set build cache location
- added option to set serve cache location
0.1.22024-11-07 : corrected behavior invite50.1.12024-11-06 : corrected path handling for non-package grammars0.1.02023-07-09 : added output caching- support grammars without a
scannercomponent
- support grammars without a
0.0.12022-06-11 : initial release
You may either add the tree-sitter-cli tool to your project as a package dependency
or have it installed locally and included on the PATH. This plugin will detect
either scenario. You can then include some tree-sitter grammar as a package
dependency or add it locally in a relative folder (in or outside of your project).
As a part of the vite rollup lifecycle, your grammar will be compiled using
tree-sitter-cli and served automatically by your development server.
When bundling for production the generated wasm files are included in the distribution.
// your project's vite.config.ts file
import { defineConfig } from "vite"
import pluginTreeSitter from "vite-plugin-tree-sitter"
export default defineConfig({
plugins: [
pluginTreeSitter(["../../github/tree-sitter-sqlite/"], {
alwaysRebuild: false,
emBuildCacheDir: null,
wasmCacheDir: ".grammar",
logLevel: "INFO",
}),
],
// 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"] },
})solidjs framework, based on solidjs template
- https://github.com/Menci/monaco-tree-sitter
- monaco editor + tree-sitter parser (via)
- fork: https://github.com/milahu/monaco-tree-sitter
- https://github.com/wolfmcnally/svelte-emscripten
- https://github.com/nshen/vite-plugin-wasm-pack
- https://github.com/lencx/vite-plugin-rsw wasm-pack plugin for Vite
- https://github.com/gliheng/vite-plugin-rust wasm-pack plugin for vite
- tree-sitter/tree-sitter#1024 Using Tree-Sitter in Browser
- https://github.com/lezer-parser/lr lezer incremental parser, used by codemirror