-
Notifications
You must be signed in to change notification settings - Fork 277
/
gulpfile.js
46 lines (39 loc) · 1.06 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
36
37
38
39
40
41
42
43
44
45
46
const gulp = require('gulp');
const clean = require('gulp-clean');
const ext_replace = require('gulp-ext-replace');
const sass = require('gulp-sass');
const bump = require('gulp-bump');
const paths = {
dist: './dist',
dve: './dev/src/ion2-calendar',
src: './src',
};
gulp.task('copy-sources', copySources);
gulp.task('copy-scss', copyScss);
gulp.task('clean-scss', cleanScss);
gulp.task('rename-scss', renameCss);
gulp.task('bump', bumpVersions);
function bumpVersions(options) {
return gulp
.src(['./package.json'], { base: './' })
.pipe(bump(options))
.pipe(gulp.dest('./'));
}
function copySources() {
return gulp.src(`${paths.dve}/**/*`).pipe(gulp.dest(paths.src));
}
function copyScss() {
return gulp
.src(`${paths.dve}/**/*.scss`)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.src));
}
function cleanScss() {
return gulp.src(`${paths.src}/**/*.css`, { read: false }).pipe(clean());
}
function renameCss() {
return gulp
.src(`${paths.src}/**/*.css`)
.pipe(ext_replace('.scss'))
.pipe(gulp.dest(paths.src));
}