提交 8f36e0aa 编写于 作者: T Tristan VALCKE

Add an npm "script" named "build-test" to build Three.Unit.js file, using new...

Add an npm "script" named "build-test" to build Three.Unit.js file, using new file rollup.unit.config.js, to three.unit.js under test/unit folder
上级 1958d55c
......@@ -27,6 +27,7 @@
},
"scripts": {
"build": "rollup -c",
"build-test": "rollup -c rollup.test.config.js",
"build-uglify": "rollup -c && uglifyjs build/three.js -cm --preamble \"// threejs.org/license\" > build/three.min.js",
"build-closure": "rollup -c && java -jar utils/build/compiler/closure-compiler-v20160713.jar --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js",
"dev": "rollup -c -w",
......
function glsl() {
return {
transform( code, id ) {
if ( /\.glsl$/.test( id ) === false ) return;
var transformedCode = 'export default ' + JSON.stringify(
code
.replace( /[ \t]*\/\/.*\n/g, '' )
.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
.replace( /\n{2,}/g, '\n' )
) + ';';
return {
code: transformedCode,
map: { mappings: '' }
};
}
};
}
export default {
entry: 'src/Three.Unit.js',
indent: '\t',
plugins: [
glsl()
],
// sourceMap: true,
targets: [
{
format: 'umd',
moduleName: 'THREE',
dest: 'test/unit/three.unit.js'
}
]
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册