Skip to content

Commit

Permalink
Modules (#9310)
Browse files Browse the repository at this point in the history
* convert to ES modules

* rebuild

* move shaders back into glsl files

* reinstate polyfills
  • Loading branch information
Rich-Harris authored and mrdoob committed Jul 22, 2016
1 parent 22a4c76 commit f65e669
Show file tree
Hide file tree
Showing 230 changed files with 30,853 additions and 29,804 deletions.
51,311 changes: 25,599 additions & 25,712 deletions build/three.js

Large diffs are not rendered by default.

1,007 changes: 14 additions & 993 deletions build/three.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"test": "test"
},
"scripts": {
"build": "node utils/build/build.js --include common --include extras",
"build-min": "node utils/build/build.js --include common --include extras --minify",
"dev": "chokidar \"./src/**/*.*\" \"./utils/build/includes/*.*\" --initial -c \"npm run build\"",
"build": "rollup -c",
"build-min": "rollup -c && uglifyjs build/three.js -cm > build/three.min.js",
"dev": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -45,6 +45,8 @@
"argparse": "^1.0.3",
"chokidar-cli": "1.2.0",
"jscs": "^1.13.1",
"rollup": "^0.33.1",
"rollup-plugin-string": "^2.0.2",
"uglify-js": "^2.6.0"
}
}
26 changes: 26 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as fs from 'fs';
import string from 'rollup-plugin-string';

var outro = `
Object.defineProperty( exports, 'AudioContext', {
get: function () {
return exports.getAudioContext();
}
});`;

var footer = fs.readFileSync( 'src/Three.Legacy.js', 'utf-8' );

export default {
entry: 'src/Three.js',
dest: 'build/three.js',
moduleName: 'THREE',
format: 'umd',
plugins: [
string({
include: '**/*.glsl'
})
],

outro: outro,
footer: footer
};
Loading

0 comments on commit f65e669

Please sign in to comment.