This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite typeof module.exports etc as "object" (#151)
- Loading branch information
1 parent
16c4a9c
commit 5ef1e6e
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var foo = 42; | ||
|
||
if ( typeof exports === 'object' && typeof module === 'object' ) { | ||
module.exports = foo; | ||
} else if ( typeof define === 'function' && define.amd ) { | ||
define([], function () { return foo; }); | ||
} else { | ||
window.foo = foo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as commonjsHelpers from 'commonjsHelpers'; | ||
|
||
var input = commonjsHelpers.createCommonjsModule(function (module, exports) { | ||
var foo = 42; | ||
|
||
if ( 'object' === 'object' && 'object' === 'object' ) { | ||
module.exports = foo; | ||
} else if ( typeof undefined === 'function' && undefined.amd ) { | ||
undefined([], function () { return foo; }); | ||
} else { | ||
window.foo = foo; | ||
} | ||
}); | ||
|
||
export default input; | ||
export { input as __moduleExports }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters