38 lines
962 B
JavaScript
38 lines
962 B
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 + 'water.js',
|
||
|
//visualPath + 'experimental.js',
|
||
|
]
|
||
|
const config = {
|
||
|
src: [
|
||
|
basePath + 'utils.js',
|
||
|
basePath + 'handler.js',
|
||
|
basePath + 'audio.js',
|
||
|
basePath + 'player.js',
|
||
|
basePath + 'gui.js',
|
||
|
basePath + 'visual.js',
|
||
|
...visuals,
|
||
|
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;
|