-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.babel.js
61 lines (55 loc) · 1.54 KB
/
gulpfile.babel.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
51
52
53
54
55
56
57
58
59
60
61
require('dotenv').config()
const gulp = require('gulp')
const del = require('del')
const fs = require('fs')
const runSequence = require('run-sequence')
const util = require('gulp-util')
const rollup = require('rollup').rollup
const commonjs = require('rollup-plugin-commonjs')
const babel = require('rollup-plugin-babel')
const nodeResolve = require('rollup-plugin-node-resolve')
const connect = require('gulp-connect')
const bump = require('gulp-bump')
const git = require('gulp-git')
const conventionalGithubReleaser = require('conventional-github-releaser')
const uglify = require('gulp-uglify')
const rename = require("gulp-rename")
const mocha = require('gulp-mocha')
require('mocha-clean');
gulp.task('uglify', function() {
gulp.src('dist/index.js')
.pipe(uglify())
.pipe(rename(function (path) {
path.basename = "isMailFine.min";
return path;
}))
.pipe(gulp.dest('dist'))
});
// Configs for all tasks
// Comments are just examples how to add posible configurations to the tasks
const rollupConf = {
entry: 'src/isMailFine.js',
plugins: [
nodeResolve({ jsnext: true }),
babel(),
commonjs({
//include: 'node_modules/**'
})
]
}
//CommonJS, suitable for Node and Browserify/Webpack format
const umdBundleConf = {
format: 'umd',
moduleName: 'isMailFine',
dest: 'dist/index.js'
}
gulp.task('build:umd', () => rollup(rollupConf).then((bundle) => bundle.write(umdBundleConf)))
gulp.task('clean', () => del(['dist']) )
gulp.task('default', ['clean'], () => (
runSequence(
[
'build:umd'
],
'uglify'
)
));