emscripten-core/emscripten

Data files are loaded from root, not from directory where js file is loaded from

開放

#12,288 建立於 2020年9月20日

 (3 則留言) (0 個反應) (0 位負責人)C++ (3,519 個分叉)batch import
good first bughelp wanted

倉庫指標

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

描述

I have a modularized wasm module that pre-js's file_packager-produced package:

/index.html (that loads dist/module.js)
/dist/module.js
/dist/module.wasm
/dist/module.data

module.wasm is indeed requested as /dist/module.wasm, but module.data is requested as /module.data, contrary to docs:

Changing the data file location
By default, the .data file containing all the preloaded files is loaded from the same URL as your .js file.

Explicit locateFile(package_name) {return '/dist/' + package_name} helped, but it would be nice if it was not needed

貢獻者指南