2019-06-29 22:16:09 +08:00
|
|
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under AGPL 3 */
|
2019-07-05 03:09:27 +08:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const header = require('gulp-header');
|
|
|
|
const stripbom = require('gulp-stripbom');
|
2019-06-29 22:16:09 +08:00
|
|
|
|
2019-07-05 03:09:27 +08:00
|
|
|
const { config } = require('./config');
|
|
|
|
const { del } = require('./common');
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
// fontastic
|
2020-10-15 22:21:52 +08:00
|
|
|
const fontasticFontsClear = () => del('snappymail/v/' + config.devVersion + '/static/css/fonts/snappymail.*');
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const fontasticFontsCopy = () =>
|
2019-07-05 03:09:27 +08:00
|
|
|
gulp
|
2020-09-25 23:42:14 +08:00
|
|
|
.src('vendors/fontastic/fonts/snappymail.*')
|
2020-10-15 22:21:52 +08:00
|
|
|
.pipe(gulp.dest('snappymail/v/' + config.devVersion + '/static/css/fonts'));
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const fontastic = gulp.series(fontasticFontsClear, fontasticFontsCopy);
|
|
|
|
|
2020-09-09 23:03:44 +08:00
|
|
|
// squire
|
2020-10-15 22:21:52 +08:00
|
|
|
const squireClear = () => del('snappymail/v/' + config.devVersion + '/static/squire');
|
2020-09-09 23:03:44 +08:00
|
|
|
|
2020-09-22 17:04:45 +08:00
|
|
|
const squire = gulp.series(squireClear);
|
2020-09-09 23:03:44 +08:00
|
|
|
|
2019-06-29 22:16:09 +08:00
|
|
|
// ckeditor
|
2020-10-15 22:21:52 +08:00
|
|
|
const ckeditorClear = () => del('snappymail/v/' + config.devVersion + '/static/ckeditor');
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const ckeditorCopy = () =>
|
2019-07-05 03:09:27 +08:00
|
|
|
gulp
|
|
|
|
.src([
|
|
|
|
'vendors/ckeditor/**/*',
|
|
|
|
'!vendors/ckeditor/samples{,/**}',
|
|
|
|
'!vendors/ckeditor/adapters{,/**}',
|
|
|
|
'!vendors/ckeditor/*.md'
|
|
|
|
])
|
2020-10-15 22:21:52 +08:00
|
|
|
.pipe(gulp.dest('snappymail/v/' + config.devVersion + '/static/ckeditor'));
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const ckeditorCopyPlugins = () =>
|
2019-07-05 03:09:27 +08:00
|
|
|
gulp
|
|
|
|
.src('vendors/ckeditor-plugins/**/*')
|
2020-10-15 22:21:52 +08:00
|
|
|
.pipe(gulp.dest('snappymail/v/' + config.devVersion + '/static/ckeditor/plugins'));
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const ckeditorSetup = () =>
|
2019-07-05 03:09:27 +08:00
|
|
|
gulp
|
2020-10-15 22:21:52 +08:00
|
|
|
.src('snappymail/v/' + config.devVersion + '/static/ckeditor/*.js')
|
2019-06-29 22:16:09 +08:00
|
|
|
.pipe(stripbom())
|
|
|
|
// eslint-disable-next-line quotes
|
2019-07-05 03:09:27 +08:00
|
|
|
.pipe(header('\uFEFF')) // BOM
|
2020-10-15 22:21:52 +08:00
|
|
|
.pipe(gulp.dest('snappymail/v/' + config.devVersion + '/static/ckeditor'));
|
2019-06-29 22:16:09 +08:00
|
|
|
|
|
|
|
const ckeditor = gulp.series(ckeditorClear, ckeditorCopy, ckeditorCopyPlugins, ckeditorSetup);
|
|
|
|
|
2020-10-15 22:21:52 +08:00
|
|
|
exports.vendors = gulp.parallel(squire, ckeditor, fontastic);
|