Skip to content

Commit 478d005

Browse files
committed
Testing new UMD wrapper.
1 parent aeda044 commit 478d005

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

src/Intro.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7-
(function(){
8-
9-
var root = this;
7+
(function (root, factory) {
8+
if (typeof define === 'function' && define.amd) {
9+
// AMD. Register as an anonymous module.
10+
define(['exports', 'Phaser'], function (exports, Phaser) {
11+
factory((root.commonJsStrictGlobal = exports), Phaser);
12+
});
13+
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
14+
// CommonJS
15+
factory(exports, require('Phaser'));
16+
} else {
17+
// Browser globals
18+
factory((root.commonJsStrictGlobal = {}), root.Phaser);
19+
}
20+
}(this, function (exports, Phaser) {
21+

src/Outro.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7-
if (typeof exports !== 'undefined') {
8-
if (typeof module !== 'undefined' && module.exports) {
9-
exports = module.exports = Phaser;
10-
}
11-
exports.Phaser = Phaser;
12-
} else if (typeof define !== 'undefined' && define.amd) {
13-
define('Phaser', (function() { return root.Phaser = Phaser; }) ());
14-
} else {
15-
root.Phaser = Phaser;
16-
}
17-
}).call(this);
7+
// attach properties to the exports object to define
8+
// the exported module properties.
9+
exports.action = function () {};
10+
}));
1811

1912
/*
2013
* "What matters in this life is not what we do but what we do for others, the legacy we leave and the imprint we make." - Eric Meyer

0 commit comments

Comments
 (0)