mootools / mootools-core

MooTools Core Repository
https://mootools.net
2.65k stars 507 forks source link

Module not compatible with CommonJS #2722

Open IvanGuardado opened 9 years ago

IvanGuardado commented 9 years ago

Here the code is accessing to the Slick global variable directly without taking in account that Slick could be defined in the exports variable.

https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.js#L264

The module should be defined like the other, using:

;function(){
  //code...
}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/21676744-module-not-compatible-with-commonjs?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github).
stefanklokgieters commented 7 years ago

What is the exact fix here? :)

IvanGuardado commented 7 years ago

@stefanklokgieters two years after I don't remember so well but the module should be defined following the CommonJS convention like the others.

stefanklokgieters commented 7 years ago

I fully get that... :)

Can you perhaps try to help me a bit further anyway? What changes exactly needed to be made? I am familiar with the ModuleJS conventions but I am not sure what you exactly mean with the proper definition. All the help is very welcome, thanks in advance!