"use strict";

const gulp = require('gulp');
const banner = require('../utils/GulpBanner.js');
const m = require('../common.js');

async function dist() {
    await m.lernaBuild();

    // now build the client app
    await m.buildClient({prodMode: true});
    await m.preparePrivateFolder();
    banner.printCompletionBanner('Build successful: ' + require('../../package.json').version);
}

gulp.task('dist', gulp.series('vendor', 'lint', (cb) => {
    dist().then(cb).catch(err => {
        logger.error(`Errors in the build process:`);
        cb(err);
    });
}, 'service-worker'));
