mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
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:
parent
466a2eba94
commit
ff24bdba9f
|
@ -1,16 +1,16 @@
|
||||||
var root = this;
|
var root = this;
|
||||||
|
|
||||||
// CommonJS/nodeJS Loader
|
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
|
||||||
module.exports = showdown;
|
|
||||||
|
|
||||||
// AMD Loader
|
// AMD Loader
|
||||||
} else if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
define(function () {
|
define(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
return showdown;
|
return showdown;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// CommonJS/nodeJS Loader
|
||||||
|
} else if (typeof module !== 'undefined' && module.exports) {
|
||||||
|
module.exports = showdown;
|
||||||
|
|
||||||
// Regular Browser loader
|
// Regular Browser loader
|
||||||
} else {
|
} else {
|
||||||
root.showdown = showdown;
|
root.showdown = showdown;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user