1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00
bitwarden-browser/gulpfile.js

37 lines
882 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-11-27 18:47:06 +01:00
function version(cb) {
2018-07-21 06:11:55 +02:00
fs.writeFileSync(paths.build + 'version.json', '{"version":"' + package.version + '"}');
2018-11-27 18:47:06 +01:00
cb();
2018-07-21 06:11:55 +02:00
}
2018-11-27 18:47:06 +01:00
exports.clean = clean;
exports.webfonts = gulp.series(clean, webfonts);
exports.prebuild = gulp.series(clean, webfonts);
exports.version = version;
exports.postdist = version;