Skip to content

Can't set memoryInitializerPrefixURL when requiring in Node.js #5216

@phraemer

Description

@phraemer

If you want to set the mem file prefix you can't do this before you require in node.
E.g.

./nodeInitScript.js
./dir_with_mem_file/myapp.js.mem
./dir_with_js_file/myapp.js

In nodeInitScript.js

global.Module = {
	'memoryInitializerPrefixURL': './dir_with_mem_file/'
};

require('./dir_with_js_file/myapp.js');
node nodeInitScript.js

But if you manually remove var Module; from myapp.js then you can.
Perhaps we need an option like -s USE_GLOBAL_MODULE_IN_NODE=1 which then doesn't output var Module;?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions