Skip to content

Commit f65e669

Browse files
Rich-Harrismrdoob
authored andcommitted
Modules (mrdoob#9310)
* convert to ES modules * rebuild * move shaders back into glsl files * reinstate polyfills
1 parent 22a4c76 commit f65e669

File tree

230 files changed

+30853
-29804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+30853
-29804
lines changed

build/three.js

Lines changed: 25599 additions & 25712 deletions
Large diffs are not rendered by default.

build/three.min.js

Lines changed: 14 additions & 993 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"test": "test"
2121
},
2222
"scripts": {
23-
"build": "node utils/build/build.js --include common --include extras",
24-
"build-min": "node utils/build/build.js --include common --include extras --minify",
25-
"dev": "chokidar \"./src/**/*.*\" \"./utils/build/includes/*.*\" --initial -c \"npm run build\"",
23+
"build": "rollup -c",
24+
"build-min": "rollup -c && uglifyjs build/three.js -cm > build/three.min.js",
25+
"dev": "rollup -c -w",
2626
"test": "echo \"Error: no test specified\" && exit 1"
2727
},
2828
"repository": {
@@ -45,6 +45,8 @@
4545
"argparse": "^1.0.3",
4646
"chokidar-cli": "1.2.0",
4747
"jscs": "^1.13.1",
48+
"rollup": "^0.33.1",
49+
"rollup-plugin-string": "^2.0.2",
4850
"uglify-js": "^2.6.0"
4951
}
5052
}

rollup.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as fs from 'fs';
2+
import string from 'rollup-plugin-string';
3+
4+
var outro = `
5+
Object.defineProperty( exports, 'AudioContext', {
6+
get: function () {
7+
return exports.getAudioContext();
8+
}
9+
});`;
10+
11+
var footer = fs.readFileSync( 'src/Three.Legacy.js', 'utf-8' );
12+
13+
export default {
14+
entry: 'src/Three.js',
15+
dest: 'build/three.js',
16+
moduleName: 'THREE',
17+
format: 'umd',
18+
plugins: [
19+
string({
20+
include: '**/*.glsl'
21+
})
22+
],
23+
24+
outro: outro,
25+
footer: footer
26+
};

0 commit comments

Comments
 (0)