fix(loader): allow AMD loader to be used within Node env

Because of the ordering of the loader, it's not possible use AMD within a Node environment.
This commit is contained in:
Jason Mitchell 2017-08-27 11:20:48 -07:00 committed by Estevão Soares dos Santos
parent 466a2eba94
commit ff24bdba9f

View File

@ -1,16 +1,16 @@
var root = this;
// CommonJS/nodeJS Loader
if (typeof module !== 'undefined' && module.exports) {
module.exports = showdown;
// AMD Loader
} else if (typeof define === 'function' && define.amd) {
if (typeof define === 'function' && define.amd) {
define(function () {
'use strict';
return showdown;
});
// CommonJS/nodeJS Loader
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = showdown;
// Regular Browser loader
} else {
root.showdown = showdown;