Thanks Juha and JJ for your replies. JJ, I will try out Module.locateFile because the final JS is quite huge when I omit the memory initializer.
On Monday, August 1, 2016 at 6:23:34 PM UTC+8, jj wrote: > > For dealing with the memory init file, there's two options that might be > useful: > - you can provide the Module.locateFile() callback function to tell the > memory init file loader where to look at: > http://kripken.github.io/emscripten-site/docs/api_reference/module.html?Module.locateFile#Module.locateFile > - or you can build with --memory-init-file 0 option to omit the the > memory initializer file altogether (it will be embedded into the .js file): > https://github.com/kripken/emscripten/blob/master/site/build/text/docs/tools_reference/emcc.txt#L440 > > > 2016-07-29 17:51 GMT+03:00 Juha Järvi <[email protected] <javascript:>>: > >> Check out nbind <https://github.com/charto/nbind#readme>, a new version >> was just released making usage in browsers easier. Also, you'll get to >> compile the Node.js version to native binary (OS X, Linux and Windows), in >> addition to an Emscripten-based asm.js fallback for web browsers and people >> without working native C++ compilers. >> >> The included toolchain handles all issues with .mem files in both Node.js >> and browsers. Feel free to ask or file an issue on Github if you have any >> problems. If for some reason you don't want to use nbind for bindings, >> you'll probably still find many parts of the toolchain useful for targeting >> both browsers and Node.js. >> >> Best regards, >> -Juha >> >> >> perjantai 29. heinäkuuta 2016 14.06.04 UTC+3 awt kirjoitti: >>> >>> Hi, >>> >>> Does anybody have any comments on this issue? Any suggestions would be >>> most welcome. Thanks. >>> >>> On Thursday, July 28, 2016 at 11:28:06 PM UTC+8, awt wrote: >>>> >>>> Hi, >>>> >>>> I have a project that comes with the mem file as well as some fonts >>>> that I preload for browser usage. I would like to package this project for >>>> node.js as well. As node doesn't support the preload setting, I have >>>> decided to deploy my fonts thru npm. >>>> >>>> I tried to use npm install to release my project but when I do a >>>> require in my test file: >>>> >>>> var testApp = require('EmscriptenApp'); >>>> >>>> I observe that EmscriptenApp.js tries to load EmscriptenApp.mem from >>>> the current directory which is where my test file is and not in the >>>> node_modules sub folder where EmscriptenApp.mem is residing. I could turn >>>> off the memory file option but would prefer not to so that I can get a >>>> better performance on the browser. >>>> >>>> The other point is that my fonts are also npm installed into subfolders >>>> in node_modules so how should I mount my FS root directory in >>>> EmscriptenApp.js to access them? >>>> >>>> Or perhaps, is there a better approach to this issue? >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
