Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Better common.js support #96

Closed
3rd-Eden opened this Issue · 1 comment

2 participants

@3rd-Eden
Owner

Currently we do a common.js check that includes testing the existence of module.exports but this property is node specific and does follow the common.js modules specification.

This prevents common.js compliant environments such as Wakanda to use plates. An easy fix would be changing:

var Plates = (typeof module !== 'undefined' && typeof module.exports !== 'undefined' && typeof exports !== 'undefined') ? exports : {};

In to:

var Plates = (typeof module !== 'undefined' && typeof module.id !== 'undefined' && typeof exports !== 'undefined') ? exports : {};

The change here is to check against module.id instead of module.exports. The module.id is required by the common.js specification and exists in Node.js and other common.js environments.

edit Testing against a require.paths would not work either, as support for that has been removed in the current node versions.

@daslicht

Just tested you modification in Wakanda and it is working !
Thank you very much !

@3rd-Eden 3rd-Eden closed this in 0d1638e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.