1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-18 12:22:59 +01:00
bitwarden-estensione-browser/gulpfile.js
2018-09-11 17:30:44 -04:00

42 lines
1.0 KiB
JavaScript

const gulp = require('gulp');
const googleWebFonts = require('gulp-google-webfonts');
const del = require('del');
const package = require('./package.json');
const fs = require('fs');
const paths = {
src: './src/',
build: './build/',
cssDir: './src/css/',
};
function clean() {
return del([paths.cssDir]);
}
function webfonts() {
return gulp.src('./webfonts.list')
.pipe(googleWebFonts({
fontsDir: 'webfonts',
cssFilename: 'webfonts.css',
format: 'woff',
}))
.pipe(gulp.dest(paths.cssDir));
};
function cleanupNodeTypes() {
return del(['./jslib/node_modules/@types/node/']);
}
function version() {
fs.writeFileSync(paths.build + 'version.json', '{"version":"' + package.version + '"}');
}
gulp.task('clean', clean);
gulp.task('webfonts', ['clean'], webfonts);
gulp.task('prebuild', ['webfonts']);
gulp.task('cleanupNodeTypes', cleanupNodeTypes);
gulp.task('predist', ['cleanupNodeTypes']);
gulp.task('version', version);
gulp.task('postdist', ['version']);