Skip to content

Requiring Node modules that support AMD causes them to try to expose themselves as AMD #398

@stevenpetryk

Description

@stevenpetryk

Most Node packages expose themselves via AMD, CommonJS (module.exports), or globals depending on the environment. I understand that React-native does indeed support AMD, but is there any way to force modules to be treated as CommonJS?

Steps to reproduce:

  1. Create a new React Native project

  2. Run npm install exoskeleton (this, along with jsSHA, are the first two libraries I noticed this with)

  3. Add the following to index.ios.js:

    var Exoskeleton = require('exoskeleton');
    console.log(Exoskeleton);
  4. Notice how, in the debug console, an empty object is logged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions