-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathrollup.config.js
More file actions
27 lines (26 loc) · 858 Bytes
/
rollup.config.js
File metadata and controls
27 lines (26 loc) · 858 Bytes
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
import typescript from "rollup-plugin-typescript2";
import terser from "@rollup/plugin-terser";
const config = [
{
input: "./src/index.ts",
// transpiled typescript in umd and es format
output: [
{ file: "dist/maxrects-packer.js", name: "MaxRectsPacker", format: "umd", sourcemap: true },
{ file: "dist/maxrects-packer.mjs", format: "es", sourcemap: true }
],
plugins: [ typescript({
tsconfig: "./tsconfig.build.json"
})]
},
{
input: "./src/index.ts",
// uglified transpiled typescript in commonjs
output: [
{ file: "dist/maxrects-packer.min.js", format: "cjs", sourcemap: false }
],
plugins: [ terser(), typescript({
tsconfig: "./tsconfig.build.json"
}) ]
}
];
export default config;