feat(web)!: rewrite the library in TypeScript
This commit is contained in:
parent
07a86b1729
commit
2cae67892e
39 changed files with 7856 additions and 3629 deletions
25
lib/binding_web/script/postinstall.js
Normal file
25
lib/binding_web/script/postinstall.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const isDebug = process.env.npm_config_web_tree_sitter_debug === 'true';
|
||||
|
||||
if (isDebug) {
|
||||
// Copy debug versions to root
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, '../debug/tree-sitter.js'),
|
||||
path.join(__dirname, '../tree-sitter.js')
|
||||
);
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, '../debug/tree-sitter.wasm'),
|
||||
path.join(__dirname, '../tree-sitter.wasm')
|
||||
);
|
||||
// Copy sourcemaps too
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, '../debug/tree-sitter.js.map'),
|
||||
path.join(__dirname, '../tree-sitter.js.map')
|
||||
);
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, '../debug/tree-sitter.wasm.map'),
|
||||
path.join(__dirname, '../tree-sitter.wasm.map')
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue