Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] loading runtime and bcl - Module.locateFile override #11099

Closed
kjpou1 opened this issue Oct 11, 2018 · 1 comment
Closed

[wasm] loading runtime and bcl - Module.locateFile override #11099

kjpou1 opened this issue Oct 11, 2018 · 1 comment

Comments

@kjpou1
Copy link
Contributor

kjpou1 commented Oct 11, 2018

Emscripten provides a Module.locateFile which can be specified in the Module.

If set, this method will be called when the runtime needs to load a file, such as a .wasm WebAssembly file, .mem memory init file, or a file generated by the file packager. The function receives the relative path to the file as configured in build process and a prefix (path to the main JavaScript file’s directory), and should return the actual URL. This lets you host file packages or the .mem file etc. on a different location than the directory of the JavaScript file (which is the default expectation), for example if you want to host them on a CDN.

The current implementation of loading the files uses the current path or the web current location where it is served from.

Supporting the locateFile on the Module as specified in the link above will introduce more flexibility into the loading. This specifically becomes more important when loading the runtime through Node.js and Electron where the files are normally read from a disk medium.

kjpou1 added a commit to kjpou1/mono that referenced this issue Oct 11, 2018
luhenry pushed a commit that referenced this issue Oct 12, 2018
* [wasm] Fix the build.

* [wasm] Add --copy parameter to packager

- copy parameter

```

        --copy=always|ifnewer        Set the type of copy to perform
                              'always' overwrites the file if it exists.
                              'ifnew' copies or overwrites the file if modified or size is different.

```

- Fix wasm build target in do-runtime target.

* [wasm] Add support for Module.locateFile to runtime loading

See issue #11099 for more information.

resolves issue: #11099

* Fix spelling of option `ifnew` to `ifnewer`
@kjpou1
Copy link
Contributor Author

kjpou1 commented Oct 15, 2018

closed by #11101

@kjpou1 kjpou1 closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant