How to use FS when MODULARIZE and EXPORT_NAME are used in emscripten

I have an application containing libraries created using emscripten. I compile them using flags:

-s MODULARIZE=1 -s EXPORT_NAME=\"'SomeModuleName'\"

However, the FS library is no longer available. When I compiled without flags, I could use the FS library in any other script.

Can I export FS to my module?

+4
source share
1 answer

FS module is not exported by default when using the flag

-s EXPORT_NAME="'SomeModuleName'"

If you want to export the FS module, you need to add a flag

-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS"]'

Then you can access Module['FS']or for this example it will be SomeModuleName['FS'] emscripten .

FS , . , - BrowserFS

+3

Source: https://habr.com/ru/post/1615172/


All Articles