forked from ellie-me/fancy-webgl-sparkles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
58 lines (51 loc) · 1.18 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
/* eslint-disable no-unused-vars */
/* eslint-disable no-console */
"use strict";
import {src, dest, task} from "gulp";
import browserify from "browserify";
import sourcemaps from "gulp-sourcemaps";
import minjs from "gulp-terser";
import buffer from "vinyl-buffer";
import source from "vinyl-source-stream";
import babel from "babelify";
export const pack = () =>
{
let bundler = browserify(["./src/fancy-webgl-sparkles.js"], { debug: false }).transform(babel);
return bundler.bundle()
.on("error", (err)=>
{
console.log(err);
})
.pipe(source("fancy-webgl-sparkles.js"))
.pipe(buffer())
.pipe(minjs())
.pipe(dest("./dist"));
};
export const noPixi = () =>
{
return src("./src/fancy-webgl-sparkles-no-pixi.js")
.pipe(buffer())
.pipe(minjs())
.pipe(dest("./dist"));
};
export const debug = () =>
{
let bundler = browserify(["./src/fancy-webgl-sparkles.js"], { debug: false }).transform(babel);
return bundler.bundle()
.on("error", (err)=>
{
console.log(err);
})
.pipe(source("fancy-webgl-sparkles-map.js"))
.pipe(buffer())
.pipe(sourcemaps.init())
.pipe(minjs())
.pipe(sourcemaps.write())
.pipe(dest("./dist"));
};
export default
{
pack,
debug,
noPixi
};