Skip to content

Commit

Permalink
fix(loader): allow AMD loader to be used within Node env
Browse files Browse the repository at this point in the history
Because of the ordering of the loader, it's not possible use AMD within a Node environment.
  • Loading branch information
jasonmit authored and tivie committed Aug 27, 2017
1 parent 466a2eb commit ff24bdb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/loader.js
@@ -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;
Expand Down

0 comments on commit ff24bdb

Please sign in to comment.