Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Only expose loadCSS on the global object if module is undefined. Play…
Browse files Browse the repository at this point in the history
… more nicely with commonjs
  • Loading branch information
scottjehl committed Nov 3, 2015
1 parent 7c129c0 commit 3740c55
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions loadCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Licensed MIT
(function(w){
"use strict";
/* exported loadCSS */
w.loadCSS = function( href, before, media ){
var loadCSS = function( href, before, media ){
// Arguments explained:
// `href` [REQUIRED] is the URL for your CSS file.
// `before` [OPTIONAL] is the element the script should use as a reference for injecting our stylesheet <link> before
Expand Down Expand Up @@ -56,7 +56,10 @@ Licensed MIT
};
// commonjs
if( typeof module !== "undefined" ){
module.exports = w.loadCSS;
module.exports = loadCSS;
}
else {
w.loadCSS = loadCSS;
}
}( typeof global !== "undefined" ? global : this ));

0 comments on commit 3740c55

Please sign in to comment.