-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
43 lines (39 loc) · 1.01 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
'use strict';
var gulp = require('gulp');
const del = require('del');
var jest = require('gulp-jest').default;
const babel = require('gulp-babel');
const rollup = require('rollup-stream');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
gulp.task('jest', function () {
return gulp.src('./test/javascripts/').pipe(jest({
"testRegex": "((\\.|/*.)(spec))\\.js?$",
"automock": false,
"verbose": true
}));
});
gulp.task('clean:node_modules', function () {
return del(['node_modules'], {force: true});
});
gulp.task('bundle', (done) => {
return rollup({
input: './app/assets/javascripts/gtm_dl.js',
format: 'iife',
sourcemap: false
})
.pipe(source('gtm_dl.js', './app/assets/javascripts/'))
.pipe(buffer())
.pipe(babel({
"presets": [
[
"@babel/preset-env",
{
"targets": "ie >= 11"
}
]
]
}))
.pipe(gulp.dest('./app/assets/javascripts/bundle'));
done();
});