emscripten-core/emscripten

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

オープン

#12,701 opened on 2020/11/04

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (3,519 件のフォーク)batch import
good first bughelp wanted

Repository metrics

Stars
 (27,361 個のスター)
PR merge metrics
 (平均マージ 19d 10h) (30d で 147 merged PRs)

説明

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 [...]

コントリビューターガイド