-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
51 lines (40 loc) · 914 Bytes
/
rollup.config.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
import typescript from "rollup-plugin-typescript2";
import cleanup from "rollup-plugin-cleanup";
// ---- settings ------------
const version = "1.2.0";
const cleanBuild = false;
// --------------------------
const bannerComment = `/**
* Image Grid Generator.
* @copyright 2019-2020 FAL
* @version ${version}
*/
`;
const globals = {
p5: "p5",
"js-yaml": "jsyaml",
};
const external = ["p5", "js-yaml"];
const typescriptPlugin = typescript({
useTsconfigDeclarationDir: true,
clean: cleanBuild,
});
const cleanupPlugin = cleanup({
comments: /^\*\*/, // preserve jsdoc comments
extensions: ["ts"],
});
const plugins = [typescriptPlugin, cleanupPlugin];
const config = {
input: "src/main.ts",
output: {
file: "build/main.js",
format: "iife",
sourcemap: true,
banner: bannerComment,
preferConst: true,
globals,
},
external,
plugins,
};
export default config;