forked from elninotech/uppload
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
43 lines (37 loc) · 936 Bytes
/
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 rollup = require("rollup");
const { nodeResolve } = require("@rollup/plugin-node-resolve");
const rollupTypescript = require("@rollup/plugin-typescript");
const exec = require("child_process").exec;
const globals = {
"focus-trap": "createFocusTrap",
mitt: "mitt",
cropperjs: "Cropper",
};
gulp.task("build", async function () {
const bundle = await rollup.rollup({
input: "./src/index.ts",
plugins: [nodeResolve(), rollupTypescript()],
external: ["focus-trap", "mitt", "cropperjs"],
});
exec("tsc");
await bundle.write({
file: "./dist/index.umd.js",
format: "umd",
name: "uppload",
sourcemap: true,
globals,
});
await bundle.write({
file: "./dist/index.cjs.js",
format: "cjs",
sourcemap: true,
globals,
});
await bundle.write({
file: "./dist/index.amd.js",
format: "amd",
sourcemap: true,
globals,
});
});