forked from iNem0o/DatPayment
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGulpfile.js
More file actions
54 lines (48 loc) · 1.44 KB
/
Gulpfile.js
File metadata and controls
54 lines (48 loc) · 1.44 KB
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
const gulp = require('gulp');
const concat = require('gulp-concat');
const bower = require('gulp-bower');
const babel = require('gulp-babel');
const sass = require('gulp-sass');
const merge = require('merge-stream');
const autoprefixer = require('gulp-autoprefixer');
const autoprefixer_versions = ['last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'];
const config = {
jsPath: './src/js',
sassPath: './src/sass',
bowerDir: './bower_components',
cardPath: './bower_components/card'
};
gulp.task('bower', function() {
return bower()
.pipe(gulp.dest(config.bowerDir))
});
gulp.task('css', function() {
return gulp.src(config.sassPath + '/DatPayment.scss')
.pipe(sass({
style: 'compressed',
includePaths: [
config.sassPath
]
}).on('error', sass.logError))
.pipe(autoprefixer(autoprefixer_versions))
.pipe(gulp.dest('./dist/css'));
});
gulp.task('js', function () {
return merge(
gulp.src([
config.cardPath + '/dist/card.js',
])
,
gulp.src([
config.jsPath+"/DatPayment.js",
])
.pipe(babel({
presets: ['es2015']
}))
).pipe(concat("DatPayment.js"))
.pipe(gulp.dest('./dist/js'))
});
gulp.task('default',function() {
gulp.watch([config.jsPath+'/*.js'],['js']);
gulp.watch([config.sassPath+'/*.scss'],['css']);
});