diff --git a/rewriter/rewriter/src/lib.rs b/rewriter/rewriter/src/lib.rs index df71c5c..060f3e2 100644 --- a/rewriter/rewriter/src/lib.rs +++ b/rewriter/rewriter/src/lib.rs @@ -37,7 +37,9 @@ where E: Clone, { let allocator = Allocator::default(); - let source_type = SourceType::default(); + let source_type = SourceType::unambiguous() + .with_javascript(true) + .with_standard(true); let ret = Parser::new(&allocator, js, source_type) .with_options(ParseOptions { parse_regular_expression: false, // default diff --git a/rewriter/wasm/build.sh b/rewriter/wasm/build.sh index fbc8065..3ffb8dd 100644 --- a/rewriter/wasm/build.sh +++ b/rewriter/wasm/build.sh @@ -29,7 +29,7 @@ sed -i 's/import.meta.url/""/g' out/wasm.js cd ../../ -wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm -p 'oxc_regular_expression::.*' -p 'oxc_parser::ts::.*' +wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm -p 'oxc_regular_expression::.*' # shellcheck disable=SC2086 time wasm-opt $WASMOPTFLAGS --converge -tnh -O4 --vacuum --dce --enable-threads --enable-bulk-memory --enable-simd rewriter/wasm/out/wasm_snipped.wasm -o rewriter/wasm/out/optimized.wasm