You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
const {src, dest, series} = require('gulp');
|
|
const del = require('del');
|
|
const ts = require('gulp-typescript');
|
|
const exec = require('child_process').exec;
|
|
let tsSource = ts.createProject('tsconfig.json')
|
|
|
|
function clean(cb) {
|
|
del(['build/*']);
|
|
cb();
|
|
}
|
|
|
|
function conf() {
|
|
return src('src/assets/**/*', {base: 'src/assets'})
|
|
.pipe(dest('build/assets/'));
|
|
}
|
|
|
|
function style(){
|
|
return src('node_modules/bootstrap/dist/css/bootstrap.css')
|
|
.pipe(dest('build/assets/pages/styles/'))
|
|
}
|
|
|
|
function root() {
|
|
return src('src/*.js')
|
|
.pipe(dest('build/'));
|
|
}
|
|
|
|
function pkg() {
|
|
return src('package*')
|
|
.pipe(dest('build/'));
|
|
}
|
|
|
|
function typescript() {
|
|
return tsSource.src()
|
|
.pipe(tsSource()).js
|
|
.pipe(dest('build/util/'));
|
|
}
|
|
|
|
function dependencies(cb) {
|
|
// Installs dependencies into build folder
|
|
exec('npm --prefix ./build install ./build --production', './node_modules/.bin/electron-rebuild -m ./build/node_modules',
|
|
(err, stdout, stderr) => {
|
|
console.log(stdout);
|
|
console.log(stderr)
|
|
cb(err);
|
|
});
|
|
}
|
|
|
|
exports.clean = clean;
|
|
|
|
exports.default = series(conf, style, root, pkg, typescript, dependencies);
|
|
|
|
exports.runFast = series(conf, style, root, pkg) |