Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Emscripten module compatibility #261

Closed
Garciat opened this issue Aug 1, 2015 · 3 comments
Closed

Emscripten module compatibility #261

Garciat opened this issue Aug 1, 2015 · 3 comments
Labels

Comments

@Garciat
Copy link

Garciat commented Aug 1, 2015

Builder makes the emscripten shell think it's running in node. It then tries to require node modules like fs.

Related discussion here. Possible solution here.

@guybedford
Copy link
Member

@Garciat it sounds like the wrapper assumes it is in Node if it is using CommonJS with process defined.

You can alter the way that SystemJS interprets the module by forcing it to be loaded as a global or amd format via meta configuration, which may then work better for building the wrapper. See https://github.com/systemjs/systemjs/blob/master/docs/module-formats.md for more info on format handling in SystemJS.

@Garciat
Copy link
Author

Garciat commented Aug 2, 2015

@guybedford I'll take a look; thanks 👍

@Garciat
Copy link
Author

Garciat commented Aug 2, 2015

Yup. That did the trick.

For future reference:

new Builder({
    ...

    meta: {
        'myapp/emscripten_module': {
            format: 'global'
        }
    }
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants