Skip to content

Commit 42b1ab3

Browse files
committed
document Module.locateFile
1 parent eb30905 commit 42b1ab3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

site/source/docs/api_reference/module.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ The following ``Module`` attributes affect code execution.
8585

8686
This is the "prefix" URL for a preloaded data file that is hosted separately from its JavaScript and HTML files (it includes the full path up to, but not including, the data file). See :ref:`packaging-files-data-file-location` for more information.
8787

88+
.. js:attribute:: Module.locateFile
89+
90+
If set, this method will be called when the runtime needs to load either a file generated by the file packager (this is a generalization of ``Module.filePackagePrefixURL``), or the ``.mem`` memory init file. In both cases the function receives the URL, and should return the actual URL. This lets you host file packages or the ``.mem`` file on a different location than the current directory (which is the default expectation), for example if you want to host them on a CDN.
8891

8992
.. js:attribute:: Module.logReadFiles
9093

9194
If set, :js:attr:`Module.printErr` will log when any file is read.
92-
95+
9396

9497
Other methods
9598
=============
@@ -99,4 +102,4 @@ Other methods
99102
This method should be called to destroy C++ objects created in JavaScript using :ref:`WebIDL bindings <WebIDL-Binder>`. If this method is not called, an object may be garbage collected, but its destructor will not be called.
100103

101104
:param obj: The JavaScript-wrapped C++ object to be destroyed.
102-
105+

0 commit comments

Comments
 (0)