Skip to content

Commit

Permalink
outro修改为CommonJs规范优先
Browse files Browse the repository at this point in the history
修改为CommonJs规范优先的原因是,在浏览器端,使用Commonjs规范加载art-template时,会默认包装一层define,如使用fis3的modjs,而这里之前是AMD规范优先,这就会导致CommonJs规范的代码也进入amd的定义逻辑中。
  • Loading branch information
lienjun committed Feb 8, 2017
1 parent eb25fea commit 950465e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/outro.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@

// CommonJs
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = template;
// RequireJS && SeaJS
if (typeof define === 'function') {
} else if (typeof define === 'function') {
define(function() {
return template;
});

// NodeJS
} else if (typeof exports !== 'undefined') {
module.exports = template;
} else {
this.template = template;
}

})();
})();

0 comments on commit 950465e

Please sign in to comment.