2019-01-02 04:19:50 -06:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const less = require('gulp-less');
|
|
|
|
const sourcemaps = require('gulp-sourcemaps');
|
2019-01-08 00:50:50 -06:00
|
|
|
const tsc = require('gulp-tsc');
|
|
|
|
const del = require('del');
|
2019-01-02 04:19:50 -06:00
|
|
|
const path = require('path');
|
|
|
|
|
2019-01-08 00:50:50 -06:00
|
|
|
// TODO: Add gulp watch tasks
|
|
|
|
|
|
|
|
gulp.task('clean', function() {
|
|
|
|
return del('lib');
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('compile', function() {
|
2019-03-19 05:52:39 -05:00
|
|
|
return gulp.src(['src/**/*.ts', 'src/**/*.tsx'])
|
2019-01-08 00:50:50 -06:00
|
|
|
.pipe(tsc({ project: './tsconfig.json' }))
|
|
|
|
.pipe(gulp.dest('lib/'))
|
|
|
|
});
|
|
|
|
|
2019-01-02 04:19:50 -06:00
|
|
|
gulp.task('less', function () {
|
|
|
|
return gulp.src('./src/**/*.less')
|
|
|
|
.pipe(sourcemaps.init())
|
|
|
|
.pipe(less())
|
|
|
|
.pipe(sourcemaps.write())
|
2019-01-08 00:50:50 -06:00
|
|
|
.pipe(gulp.dest(path.join(__dirname, 'lib/src')));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('copy', function () {
|
|
|
|
return gulp.src([
|
|
|
|
'./src/renderer/assets/*',
|
2019-01-08 04:21:52 -06:00
|
|
|
'./src/renderer/*.html',
|
|
|
|
'./src/locale/*'
|
2019-01-08 00:50:50 -06:00
|
|
|
], {
|
|
|
|
"base": "./src"
|
|
|
|
}).pipe(gulp.dest('lib/src'))
|
|
|
|
});
|
|
|
|
|
2019-03-19 05:52:39 -05:00
|
|
|
gulp.task('build', gulp.series('clean', 'compile', 'less', 'copy'));
|