Files
Chamilo/web/assets/vrview/src/third_party/three/rollup.config.js
2025-04-10 11:37:29 +02:00

34 lines
614 B
JavaScript

import * as fs from 'fs';
var outro = `
Object.defineProperty( exports, 'AudioContext', {
get: function () {
return exports.getAudioContext();
}
});`;
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/third_party/three/Three.js',
dest: 'build/three.js',
moduleName: 'THREE',
format: 'umd',
plugins: [
glsl()
],
outro: outro
};