1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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.js',
- indent: '\t',
- plugins: [
- glsl()
- ],
- // sourceMap: true,
- targets: [
- {
- format: 'umd',
- moduleName: 'THREE',
- dest: 'build/three.js'
- },
- {
- format: 'es',
- dest: 'build/three.module.js'
- }
- ]
- };
|