1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00
bitwarden-browser/gulpfile.js

36 lines
869 B
JavaScript
Raw Normal View History

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-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-09-11 23:49:43 +02:00
gulp.task('prebuild', ['webfonts']);
2018-07-21 06:11:55 +02:00
gulp.task('version', version);
gulp.task('postdist', ['version']);