di.js icon indicating copy to clipboard operation
di.js copied to clipboard

Exporting DI as a CommonJS module

Open jhenriquez opened this issue 10 years ago • 1 comments

I might be missing a point, but I hope you could clarify me. Would there be any issues with exporting di as CommonJS module so it can naturally be used in node with simple require('di-lite'); ?

I've added an index.js file requiring './di-lite' and added a simple export ceremony like:

if (module && module.exports) {
    module.exports = di;
}

for testing and it seems to be working. Is there something am not foreseeing? Would this affect the operation of the library in the browser?

jhenriquez avatar Feb 22 '15 16:02 jhenriquez

+1

neich avatar Aug 12 '15 11:08 neich