-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup-build.config.ts
50 lines (44 loc) · 977 Bytes
/
rollup-build.config.ts
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
import ts from "rollup-plugin-ts";
import path from "path";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import progress from "rollup-plugin-progress";
import { terser } from "rollup-plugin-terser";
const folders = {
src: path.resolve(__dirname, "src/lib"),
dist: path.resolve(__dirname, "dist"),
dist_umd: path.resolve(__dirname, "dist/umd")
};
const files = {
src_index: path.join(folders.src, "index.ts"),
dist_umd_masonry_layout: path.join(folders.dist_umd, "masonry-layout.min.js")
};
const plugins = () => [
progress(),
resolve(),
ts({
tsconfig: "tsconfig.build.json"
}),
commonjs({
include: "**/node_modules/**"
})
];
const configs = [
{
input: files.src_index,
output: [
{
format: "umd",
name: "masonry-layout",
file: files.dist_umd_masonry_layout
}
],
plugins: [
...plugins(),
terser()
],
treeshake: true,
context: "window"
}
];
export default configs;