emscripten-core/emscripten

file-packager js output not working with closure and --pre-js

Open

#12,701 建立於 2020年11月4日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)C++ (3,519 fork)batch import
good first bughelp wanted

倉庫指標

Star
 (27,361 star)
PR 合併指標
 (平均合併 19天 10小時) (30 天內合併 147 個 PR)

描述

I'm getting the following closure error when adding the output of file-packager using --pre-js:

ERROR - [JSC_VAR_MULTIPLY_DECLARED_ERROR] Variable Module declared more than once.

Using --preload-file instead works fine which leads me to believe this is a bug.

Commands for completeness:

file_packager.py testapp.resources.data --preload testapp/resources@resources --js-output=testapp.resources.js --use-preload-cache
em++ -s WASM=1 -DNDEBUG -O3 -s ENVIRONMENT=web -s MODULARIZE -s EXPORT_NAME=createModule -flto --closure 1 -s FORCE_FILESYSTEM --pre-js testapp.resources.js [...]

貢獻者指南