52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
const terser = require('gulp-terser'),
|
|
concat = require('gulp-concat'),
|
|
rename = require('gulp-rename'),
|
|
gulp = require('gulp');
|
|
|
|
const basePath = __dirname + '/../../raw/javascript/';
|
|
const visualPath = basePath + 'visuals/';
|
|
const visuals = [
|
|
visualPath + 'sphere.js',
|
|
visualPath + 'wave.js',
|
|
visualPath + 'wave2d.js',
|
|
visualPath + 'water.js',
|
|
//visualPath + 'experimental.js',
|
|
]
|
|
const config = {
|
|
src: [
|
|
basePath + 'utils.js',
|
|
basePath + 'gl/glUtils.js',
|
|
basePath + 'gl/Camera.js',
|
|
basePath + 'template.js',
|
|
basePath + 'gl/handler.js',
|
|
basePath + 'audio.js',
|
|
basePath + 'FileHandler.js',
|
|
basePath + 'FetchHandler.js',
|
|
basePath + 'playerConfigHandler.js',
|
|
basePath + 'player.js',
|
|
basePath + 'gui.js',
|
|
basePath + 'visual.js',
|
|
basePath + 'imageUploader.js',
|
|
basePath + 'notification.js',
|
|
basePath + 'config.js',
|
|
...visuals,
|
|
basePath + 'eventHandler.js',
|
|
basePath + 'select.js',
|
|
basePath + 'keys.js',
|
|
basePath + 'startup.js',
|
|
basePath + 'app.js'
|
|
],
|
|
dest: __dirname + '/../../out/js'
|
|
};
|
|
|
|
function build() {
|
|
return gulp.src(config.src)
|
|
.pipe(concat('scripts.js'))
|
|
.pipe(gulp.dest(config.dest))
|
|
.pipe(rename('scripts.min.js'))
|
|
.pipe(terser().on('error', console.error))
|
|
.pipe(gulp.dest(config.dest));
|
|
}
|
|
|
|
module.exports.build = build;
|