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.
Merge pull request #62 from rollup/consume-umd
Transform typeof require to 'function'
- Loading branch information
Showing
5 changed files
with
107 additions
and
12 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,5 @@ | ||
if ( typeof require === 'function' ) { | ||
module.exports = function ( require ) { | ||
return typeof require; | ||
}( {} ); | ||
} |
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,11 @@ | ||
// From https://github.com/rollup/rollup-plugin-commonjs/issues/38 | ||
(function(global, factory) { | ||
/* AMD */ if (typeof define === 'function' && define["amd"]) | ||
define(["bytebuffer"], factory); | ||
/* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module["exports"]) | ||
module["exports"] = factory(require("bytebuffer"), true); | ||
/* Global */ else | ||
(global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); | ||
})(this, function(ByteBuffer, isCommonJS) { | ||
return isCommonJS; | ||
}) |
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,40 @@ | ||
// From https://github.com/rollup/rollup-plugin-commonjs/issues/38 | ||
var sinon = (function () { // eslint-disable-line no-unused-vars | ||
"use strict"; | ||
|
||
var sinonModule; | ||
var isNode = typeof module !== "undefined" && module.exports && typeof require === "function"; | ||
var isAMD = typeof define === "function" && typeof define.amd === "object" && define.amd; | ||
|
||
function loadDependencies(require, exports, module) { | ||
sinonModule = module.exports = require("./sinon/util/core"); | ||
require("./sinon/extend"); | ||
require("./sinon/walk"); | ||
require("./sinon/typeOf"); | ||
require("./sinon/times_in_words"); | ||
require("./sinon/spy"); | ||
require("./sinon/call"); | ||
require("./sinon/behavior"); | ||
require("./sinon/stub"); | ||
require("./sinon/mock"); | ||
require("./sinon/collection"); | ||
require("./sinon/assert"); | ||
require("./sinon/sandbox"); | ||
require("./sinon/test"); | ||
require("./sinon/test_case"); | ||
require("./sinon/match"); | ||
require("./sinon/format"); | ||
require("./sinon/log_error"); | ||
} | ||
|
||
if (isAMD) { | ||
define(loadDependencies); | ||
} else if (isNode) { | ||
loadDependencies(require, module.exports, module); | ||
sinonModule = module.exports; | ||
} else { | ||
sinonModule = {}; | ||
} | ||
|
||
return sinonModule; | ||
}()); |
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