Browse Source

Add build step for tiktoken wasm

Saoud Rizwan 1 year ago
parent
commit
2a0a5435bc
1 changed files with 7 additions and 0 deletions
  1. 7 0
      esbuild.js

+ 7 - 0
esbuild.js

@@ -29,6 +29,13 @@ const copyWasmFiles = {
 	name: "copy-wasm-files",
 	setup(build) {
 		build.onEnd(() => {
+			// tiktoken
+			fs.copyFileSync(
+				path.join(__dirname, "node_modules", "tiktoken", "tiktoken_bg.wasm"),
+				path.join(__dirname, "dist", "tiktoken_bg.wasm")
+			)
+
+			// tree sitter
 			const sourceDir = path.join(__dirname, "node_modules", "web-tree-sitter")
 			const targetDir = path.join(__dirname, "dist")