forked from ForEvolve/bootstrap-dark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (44 loc) · 1.55 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
cleanCss = require('gulp-clean-css'),
rename = require('gulp-rename'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer');
gulp.task('build-theme', function () {
return gulp.src(['scss/bootstrap-dark.scss'])
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(postcss([autoprefixer({
browsers: [
'Chrome >= 35',
'Firefox >= 38',
'Edge >= 12',
'Explorer >= 10',
'iOS >= 8',
'Safari >= 8',
'Android 2.3',
'Android >= 4',
'Opera >= 12']
})]))
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist/css/'))
.pipe(cleanCss())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist/css/'))
});
gulp.task('copy-bootstrap-js', function () {
return gulp
.src(['node_modules/bootstrap/dist/js/*'])
.pipe(gulp.dest('dist/js/'));
});
gulp.task('copy-dist-to-wwwroot', function () {
return gulp
.src(['dist/**/*'])
.pipe(gulp.dest('wwwroot/'));
});
gulp.task('watch', gulp.series(gulp.parallel('copy-bootstrap-js', 'build-theme'), function () {
gulp.watch(['scss/*.scss'], gulp.series('build-theme', 'copy-dist-to-wwwroot'));
}));
gulp.task('default', gulp.parallel('copy-bootstrap-js', gulp.series('build-theme', 'copy-dist-to-wwwroot')), function () {
});