-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgulpfile.js
48 lines (40 loc) · 1.37 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
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
require("@babel/register")({
ignore: [/node_modules/]
});
const gulp = require('gulp');
const jest = require('gulp-jest').default;
const eslint = require('gulp-eslint');
const webpackStream = require('webpack-stream');
const source = ['src/main/index.js'];
gulp.task('test', function() {
return gulp.src('./src/test')
.pipe(jest({
"reporters": ["default", "./node_modules/jest-html-reporter"],
"collectCoverageFrom": [
"**/src/main/baseConnector*",
"**/src/main/types*"
],
"collectCoverage": true,
"automock": false,
"clearMocks": true
}));
});
gulp.task('lint', function() {
return gulp.src(['./src/main/*.js', './src/test/*.js'])
.pipe(eslint({compilers: "js:babel-core/register"}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('bundle', gulp.series('lint', 'test', function() {
var webpackConfig = require('./webpack.config');
return gulp.src(source)
.pipe(webpackStream(webpackConfig))
.pipe(gulp.dest('./dist/'));
}));
gulp.task('default', gulp.series('bundle'));