audio-vis/build/task/js.js

44 lines
1.2 KiB
JavaScript
Raw 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',
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-01 21:51:54 +02:00
basePath + 'template.js',
basePath + 'gl/handler.js',
2020-04-07 21:44:46 +02:00
basePath + 'audio.js',
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-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'))
.pipe(terser())
.pipe(gulp.dest(config.dest));
}
module.exports.build = build;