File tree Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Original file line number Diff line number Diff line change 3030set -e
3131
3232web_dir=lib/binding_web
33- exports=$( cat ${web_dir} /exports.json)
3433emscripten_flags=" -O3"
3534minify_js=1
3635force_docker=0
@@ -79,25 +78,27 @@ mkdir -p target/scratch
7978
8079# Use emscripten to generate `tree-sitter.js` and `tree-sitter.wasm`
8180# in the `target/scratch` directory
82- $emcc \
83- -s WASM=1 \
84- -s TOTAL_MEMORY=33554432 \
85- -s ALLOW_MEMORY_GROWTH=1 \
86- -s MAIN_MODULE=2 \
87- -s NO_FILESYSTEM=1 \
88- -s " EXPORTED_FUNCTIONS=${exports} " \
89- $emscripten_flags \
90- -std=c99 \
91- -D ' fprintf(...)=' \
92- -D NDEBUG= \
93- -I lib/src \
94- -I lib/include \
95- --js-library ${web_dir} /imports.js \
96- --pre-js ${web_dir} /prefix.js \
97- --post-js ${web_dir} /binding.js \
98- --post-js ${web_dir} /suffix.js \
99- lib/src/lib.c \
100- ${web_dir} /binding.c \
81+ $emcc \
82+ -s WASM=1 \
83+ -s TOTAL_MEMORY=33554432 \
84+ -s ALLOW_MEMORY_GROWTH=1 \
85+ -s MAIN_MODULE=2 \
86+ -s NO_FILESYSTEM=1 \
87+ -s NODEJS_CATCH_EXIT=0 \
88+ -s NODEJS_CATCH_REJECTION=0 \
89+ -s EXPORTED_FUNCTIONS=@${web_dir} /exports.json \
90+ $emscripten_flags \
91+ -std=c99 \
92+ -D ' fprintf(...)=' \
93+ -D NDEBUG= \
94+ -I lib/src \
95+ -I lib/include \
96+ --js-library ${web_dir} /imports.js \
97+ --pre-js ${web_dir} /prefix.js \
98+ --post-js ${web_dir} /binding.js \
99+ --post-js ${web_dir} /suffix.js \
100+ lib/src/lib.c \
101+ ${web_dir} /binding.c \
101102 -o target/scratch/tree-sitter.js
102103
103104# Use terser to write a minified version of `tree-sitter.js` into
You can’t perform that action at this time.
0 commit comments