-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
43 lines (37 loc) · 1.11 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
const gulp = require("gulp")
const babel = require("gulp-babel")
const rollup = require("gulp-rollup")
const rename = require("gulp-rename")
const mocha = require("gulp-mocha")
const uglify = require("gulp-uglify")
const { task, src, dest, series, watch } = gulp
task("rollup", function () {
return src("./src/storage.js")
.pipe(
rollup({
input: "./src/storage.js",
output: {
format: "umd",
name: "fastore",
},
})
)
.pipe(rename('fastore.js'))
.pipe(dest("./build", { file: 'fastore.js' }))
})
task("test", function () {
return src(["./tests/**/*.js", "!./tests/**/*.spec.js"]).pipe(mocha({
timeout: 10000,
require: "@babel/register",
}))
})
task("test-watch", function () {
watch(["./src/storage.js", "./tests/**/*.js", "!./tests/**/*.spec.js"], series("test"))
})
task("build", function () {
return src("./build/fastore.js")
.pipe(babel())
.pipe(uglify())
.pipe(dest("./dist"))
})
task("default", series("rollup", "build"))