|
@@ -1,5 +1,4 @@
|
|
|
import * as fs from 'fs';
|
|
|
-import string from 'rollup-plugin-string';
|
|
|
|
|
|
var outro = `
|
|
|
Object.defineProperty( exports, 'AudioContext', {
|
|
@@ -10,15 +9,28 @@ Object.defineProperty( exports, 'AudioContext', {
|
|
|
|
|
|
var footer = fs.readFileSync( 'src/Three.Legacy.js', 'utf-8' );
|
|
|
|
|
|
+function glsl () {
|
|
|
+ return {
|
|
|
+ transform ( code, id ) {
|
|
|
+ if ( !/\.glsl$/.test( id ) ) return;
|
|
|
+
|
|
|
+ return 'export default ' + JSON.stringify(
|
|
|
+ code
|
|
|
+ .replace( /[ \t]*\/\/.*\n/g, '' )
|
|
|
+ .replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
|
|
|
+ .replace( /\n{2,}/g, '\n' )
|
|
|
+ ) + ';';
|
|
|
+ }
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
export default {
|
|
|
entry: 'src/Three.js',
|
|
|
dest: 'build/three.js',
|
|
|
moduleName: 'THREE',
|
|
|
format: 'umd',
|
|
|
plugins: [
|
|
|
- string({
|
|
|
- include: '**/*.glsl'
|
|
|
- })
|
|
|
+ glsl()
|
|
|
],
|
|
|
|
|
|
outro: outro,
|