Skip to content

Commit e7230a5

Browse files
terkelgmrdoob
authored andcommitted
Converted to module (#72)
1 parent a58ac96 commit e7230a5

File tree

8 files changed

+17
-11
lines changed

8 files changed

+17
-11
lines changed

build/stats.min.js

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stats.js",
3-
"version": "0.16.0",
3+
"version": "0.17.0",
44
"description": "JavaScript Performance Monitor",
55
"main": "build/stats.min.js",
66
"directories": {
@@ -11,6 +11,9 @@
1111
"src"
1212
],
1313
"scripts": {
14+
"build": "rollup -c",
15+
"build-uglify": "rollup -c && uglifyjs build/stats.js -cm --preamble \"// stats.js - http://github.com/mrdoob/stats.js\" > build/stats.min.js",
16+
"build-closure": "rollup -c && java -jar utils/compiler/compiler.jar --language_in=ECMASCRIPT5_STRICT --js build/stats.js --js_output_file build/stats.min.js",
1417
"test": "echo \"Error: no test specified\" && exit 1"
1518
},
1619
"repository": {
@@ -27,5 +30,9 @@
2730
"bugs": {
2831
"url": "https://github.com/mrdoob/stats.js/issues"
2932
},
30-
"homepage": "https://github.com/mrdoob/stats.js"
33+
"homepage": "https://github.com/mrdoob/stats.js",
34+
"devDependencies": {
35+
"rollup": "^0.36.0",
36+
"uglifyjs": "^2.4.10"
37+
}
3138
}

rollup.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
entry: 'src/Stats.js',
3+
dest: 'build/stats.js',
4+
moduleName: 'Stats',
5+
format: 'umd'
6+
};

src/Stats.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,4 @@ Stats.Panel = function ( name, fg, bg ) {
168168

169169
};
170170

171-
if ( typeof module === 'object' ) {
172-
173-
module.exports = Stats;
174-
175-
}
171+
export { Stats as default };

utils/builder.py

100644100755
File mode changed.

utils/compiler/COPYING

100644100755
File mode changed.

utils/compiler/README.md

100644100755
File mode changed.

utils/compiler/compiler.jar

188 KB
Binary file not shown.

0 commit comments

Comments
 (0)