2018-07-18 16:54:22 +02:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const googleWebFonts = require('gulp-google-webfonts');
|
2018-07-18 17:15:23 +02:00
|
|
|
const del = require('del');
|
2018-07-21 06:11:55 +02:00
|
|
|
const package = require('./package.json');
|
|
|
|
const fs = require('fs');
|
2018-07-18 16:54:22 +02:00
|
|
|
|
2018-07-18 17:15:23 +02:00
|
|
|
const paths = {
|
2018-07-21 06:11:55 +02:00
|
|
|
src: './src/',
|
|
|
|
build: './build/',
|
2018-07-18 17:15:23 +02:00
|
|
|
cssDir: './src/css/',
|
|
|
|
};
|
|
|
|
|
|
|
|
function clean() {
|
|
|
|
return del([paths.cssDir]);
|
|
|
|
}
|
2018-07-18 16:54:22 +02:00
|
|
|
|
2018-07-18 17:15:23 +02:00
|
|
|
function webfonts() {
|
2018-07-18 16:54:22 +02:00
|
|
|
return gulp.src('./webfonts.list')
|
|
|
|
.pipe(googleWebFonts({
|
|
|
|
fontsDir: 'webfonts',
|
2018-07-18 17:15:23 +02:00
|
|
|
cssFilename: 'webfonts.css',
|
|
|
|
format: 'woff',
|
2018-07-18 16:54:22 +02:00
|
|
|
}))
|
2018-07-18 17:15:23 +02:00
|
|
|
.pipe(gulp.dest(paths.cssDir));
|
|
|
|
};
|
|
|
|
|
2018-09-11 23:30:44 +02:00
|
|
|
function cleanupNodeTypes() {
|
|
|
|
return del(['./jslib/node_modules/@types/node/']);
|
|
|
|
}
|
|
|
|
|
2018-07-21 06:11:55 +02:00
|
|
|
function version() {
|
|
|
|
fs.writeFileSync(paths.build + 'version.json', '{"version":"' + package.version + '"}');
|
|
|
|
}
|
|
|
|
|
2018-07-18 17:15:23 +02:00
|
|
|
gulp.task('clean', clean);
|
|
|
|
gulp.task('webfonts', ['clean'], webfonts);
|
2018-07-21 06:11:55 +02:00
|
|
|
gulp.task('prebuild', ['webfonts']);
|
2018-09-11 23:30:44 +02:00
|
|
|
gulp.task('cleanupNodeTypes', cleanupNodeTypes);
|
|
|
|
gulp.task('predist', ['cleanupNodeTypes']);
|
2018-07-21 06:11:55 +02:00
|
|
|
gulp.task('version', version);
|
|
|
|
gulp.task('postdist', ['version']);
|