-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
59 lines (50 loc) · 1.53 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
47
48
49
50
51
52
53
54
55
56
57
58
59
let gulp = require('gulp');
let scss = require('gulp-sass');
let px2rem = require('gulp-px2rem');
let rename = require('gulp-rename');
let gulpSequence = require('gulp-sequence');
let removeScss = require('./scripts/gulp-remove.js');
let renameScssRequire = require('./scripts/gulp-rename-scss.js');
const px2remOptions = {
rootValue: 100,
replace: true,
minPx: 2,
};
const postCssOptions = {
map: true,
};
gulp.task('compileScss', function () {
return gulp
.src('examples_src/src/auto-ui/components/**/*.scss')
.pipe(scss({ outputStyle: 'expanded' }))
.pipe(px2rem(px2remOptions, postCssOptions))
.pipe(gulp.dest('lib'));
});
gulp.task('removeScssRequire', function () {
return gulp.src(['lib/**/*.js', 'lib/**/*.d.ts']).pipe(removeScss()).pipe(gulp.dest('lib/'));
});
gulp.task('renameScssRequire', function () {
return gulp.src(['lib/**/style/*.js', 'lib/**/style/*.d.ts']).pipe(renameScssRequire()).pipe(gulp.dest('lib/'));
});
gulp.task('renameIndexToCss', function () {
return gulp
.src('lib/**/style/index.js')
.pipe(
rename(function (path) {
path.basename = 'css';
})
)
.pipe(gulp.dest('lib/'));
});
gulp.task('renameESIndexToCss', function () {
return gulp
.src('es/**/style/index.js')
.pipe(
rename(function (path) {
path.basename = 'css';
})
)
.pipe(gulp.dest('es/'));
});
gulp.task('default', gulp.series('compileScss', 'removeScssRequire', 'renameScssRequire', 'renameIndexToCss'));
gulp.task('es', gulp.series('renameESIndexToCss'));