forked from overtrue/bootstrap-theme-slim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
50 lines (43 loc) · 1.18 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var rename = require("gulp-rename");
var cleanCSS = require('gulp-clean-css');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var bootstrap = {
scss: [],
// scss: ['node_modules/bootstrap/scss/**.scss'],
js: ['node_modules/bootstrap/dist/js/bootstrap.min.js'],
};
var slim = {
scss: ['src/scss/*.scss'],
js: ['src/js/*.js'],
}
var dist = {
css: 'dist/css/',
js: 'dist/js/',
};
gulp.task('sass', function() {
gulp.src(bootstrap.scss.concat(slim.scss))
.pipe(sass())
.pipe(cleanCSS())
.pipe(sourcemaps.write())
.pipe(autoprefixer({
browsers: ['last 2 versions', 'Android >= 4.0'],
cascade: true,
remove:true
}))
.pipe(rename({suffix: "-min"}))
.pipe(gulp.dest(dist.css));
});
gulp.task('js', function() {
console.log(bootstrap.js.concat(slim.js))
gulp.src(bootstrap.js.concat(slim.js))
.pipe(sourcemaps.write())
.pipe(gulp.dest(dist.js));
});
gulp.task('watch', function () {
gulp.watch(slim.scss, ['sass']);
gulp.watch(slim.js, ['js']);
});
gulp.task('default', ['sass', 'js']);