Skip to content

Commit e395497

Browse files
Revert "HACK: Patch ES6 module to be compatible with vitest"
This reverts commit c4017c3.
1 parent c4017c3 commit e395497

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

modules/patch.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,3 @@ def apply_public_headers(target):
4848
l.bullet("Applied: public headers (p2)", l.GREEN)
4949
else:
5050
l.bullet("Skipped: public headers (p2)", l.PURPLE)
51-
52-
53-
# -----------------------------------------------------------------------------
54-
def apply_es6_bundler_fix(js_path):
55-
l.colored("Applying: ES6 bundler fix...", l.YELLOW)
56-
original_content = 'scriptDirectory=require("url").fileURLToPath(new URL("./",import.meta.url));'
57-
has_content = f.file_has_content(js_path, original_content)
58-
59-
if not has_content:
60-
l.e("Failed to apply: ES6 bundler fix", True)
61-
62-
f.replace_in_file(
63-
js_path,
64-
original_content,
65-
'scriptDirectory = __dirname + "/";'
66-
)
67-
l.colored("Applied: ES6 bundler fix", l.GREEN)

modules/wasm.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,21 +668,15 @@ def run_task_generate():
668668

669669
# Generate ES6 module, only .js will be generated (no .wasm)
670670
l.colored("Compiling ES6 module with emscripten...", l.YELLOW)
671-
es6_js_path = os.path.join(gen_out_dir, "pdfium.esm.js")
672671
es6_command = [
673672
*base_command,
674673
"-s"
675674
"EXPORT_ES6=1",
676675
"-o",
677-
es6_js_path,
676+
os.path.join(gen_out_dir, "pdfium.esm.js"),
678677
]
679678
r.run(" ".join(es6_command), cwd=gen_utils_dir, shell=True)
680679

681-
# XXX: patch es6 module to be compatible with vitest
682-
# We should remove this once we upgrade Emscripten to a version including https://github.com/emscripten-core/emscripten/pull/22605
683-
l.colored("Patching ES6 module...", l.YELLOW)
684-
patch.apply_es6_bundler_fix(es6_js_path)
685-
686680
# copy files
687681
l.colored("Copying compiled files...", l.YELLOW)
688682

0 commit comments

Comments
 (0)