audio-vis/build/task/js.js

52 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2020-04-07 21:44:46 +02:00
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',
2020-08-01 21:51:54 +02:00
visualPath + 'wave.js',
2020-08-06 23:44:37 +02:00
visualPath + 'wave2d.js',
2020-08-01 21:51:54 +02:00
visualPath + 'water.js',
2020-04-07 21:44:46 +02:00
//visualPath + 'experimental.js',
]
const config = {
src: [
basePath + 'utils.js',
basePath + 'gl/glUtils.js',
2020-08-08 21:58:15 +02:00
basePath + 'gl/Camera.js',
2020-08-01 21:51:54 +02:00
basePath + 'template.js',
basePath + 'gl/handler.js',
2020-04-07 21:44:46 +02:00
basePath + 'audio.js',
2020-08-06 23:44:37 +02:00
basePath + 'FileHandler.js',
2020-08-08 21:58:15 +02:00
basePath + 'FetchHandler.js',
2020-08-06 23:44:37 +02:00
basePath + 'playerConfigHandler.js',
2020-04-07 21:44:46 +02:00
basePath + 'player.js',
basePath + 'gui.js',
basePath + 'visual.js',
basePath + 'imageUploader.js',
basePath + 'notification.js',
2020-08-01 21:51:54 +02:00
basePath + 'config.js',
2020-04-07 21:44:46 +02:00
...visuals,
2020-08-01 21:51:54 +02:00
basePath + 'eventHandler.js',
2020-08-06 23:44:37 +02:00
basePath + 'select.js',
2020-08-07 19:31:30 +02:00
basePath + 'keys.js',
2020-08-06 23:44:37 +02:00
basePath + 'startup.js',
2020-04-07 21:44:46 +02:00
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'))
2020-08-08 21:58:15 +02:00
.pipe(terser().on('error', console.error))
2020-04-07 21:44:46 +02:00
.pipe(gulp.dest(config.dest));
}
module.exports.build = build;