123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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 [
- // editor unit conf
- {
- input: 'test/three.editor.unit.js',
- plugins: [
- glsl()
- ],
- // sourceMap: true,
- output: [
- {
- format: 'umd',
- name: 'THREE',
- file: 'test/unit/three.editor.unit.js',
- intro: 'QUnit.module( "Editor", () => {',
- outro: '} );',
- indent: '\t',
- }
- ]
- },
- // example unit conf
- {
- input: 'test/three.example.unit.js',
- plugins: [
- glsl()
- ],
- // sourceMap: true,
- output: [
- {
- format: 'umd',
- name: 'THREE',
- file: 'test/unit/three.example.unit.js',
- intro: 'QUnit.module( "Example", () => {',
- outro: '} );',
- indent: '\t',
- }
- ]
- },
- // source unit conf
- {
- input: 'test/three.source.unit.js',
- plugins: [
- glsl()
- ],
- // sourceMap: true,
- output: [
- {
- format: 'umd',
- name: 'THREE',
- file: 'test/unit/three.source.unit.js',
- intro: 'QUnit.module( "Source", () => {',
- outro: '} );',
- indent: '\t',
- }
- ]
- },
- ];
|