Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Amd module with return doesn't get populated on node.js #6

@bitplanets

Description

@bitplanets

A module like this will return {}

define(function(require, exports, module){

    var logic = {
        a: 3
    }
    return logic;
});

Here is the index.js

var myRequire2 = require('enhanced-require')(module);
console.log(myRequire2('./test'))

This will output {} instead of {logic: 3}. Why is this happening and how to fix it?

I can't change all the define(function(require, exports, module){ files to make them work with module.exports = logic. (The module.exports works ok)

On the client side with webpack works perfectly fine.

Thanks

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