diff --git a/wNumb.js b/wNumb.js index 722b629..75c66ee 100644 --- a/wNumb.js +++ b/wNumb.js @@ -1,4 +1,22 @@ -(function(){ +(function (factory) { + + if ( typeof define === 'function' && define.amd ) { + + // AMD. Register as an anonymous module. + define([], factory); + + } else if ( typeof exports === 'object' ) { + + // Node/CommonJS + module.exports = factory(); + + } else { + + // Browser globals + window.wNumb = factory(); + } + +}(function(){ 'use strict'; @@ -330,6 +348,6 @@ var } /** @export */ - window.wNumb = wNumb; + return wNumb; -}()); +}));