forked from craftcms/ckeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (30 loc) · 1.09 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
var ckeditorPath = 'node_modules/@ckeditor';
var libPath = 'lib';
var fieldPath = 'src/assets/field/dist';
gulp.task('ckeditor-classic', function() {
return gulp.src(ckeditorPath+'/ckeditor5-build-classic/build/*')
.pipe(gulp.dest(libPath+'/ckeditor/dist'));
});
gulp.task('craft-sass', function() {
return gulp.src('node_modules/craftcms-sass/src/_mixins.scss')
.pipe(gulp.dest('lib/craftcms-sass'));
});
gulp.task('field-css', function() {
return gulp.src(fieldPath+'/css/ckeditor-field.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(cleanCSS())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(fieldPath+'/css'));
});
gulp.task('ckeditor', ['ckeditor-classic']);
gulp.task('field', ['field-css']);
gulp.task('default', ['ckeditor', 'field']);