50 lines
1.4 KiB
JavaScript
50 lines
1.4 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 + 'template.js',
|
|
basePath + 'gl/handler.js',
|
|
basePath + 'audio.js',
|
|
basePath + 'FileHandler.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())
|
|
.pipe(gulp.dest(config.dest));
|
|
}
|
|
|
|
module.exports.build = build;
|