-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
43 lines (41 loc) · 1.4 KB
/
rollup.config.mjs
File metadata and controls
43 lines (41 loc) · 1.4 KB
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
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";
import nodeResolve from "@rollup/plugin-node-resolve";
import {defineConfig} from "rollup";
import dts from "rollup-plugin-dts";
export default [
defineConfig({
input: "dist/ts/printer.js",
output: [
{file: "dist/index.esm.js", format: "esm", sourcemap: true},
{file: "dist/index.esm.min.js", format: "esm", plugins: [terser()], sourcemap: true},
{file: "dist/index.cjs.js", format: "cjs", exports: "named", sourcemap: true},
{file: "dist/index.cjs.min.js", format: "cjs", exports: "named", plugins: [terser()], sourcemap: true},
{
file: "dist/index.umd.js",
format: "umd",
name: "Printer",
exports: "named",
sourcemap: true
},
{
file: "dist/index.umd.min.js",
format: "umd",
name: "Printer",
exports: "named",
plugins: [terser()],
sourcemap: true
}
],
plugins: [
nodeResolve({preferBuiltins: false}),
commonjs()
]
}),
// TypeScript definitions
defineConfig({
input: "dist/ts/printer.d.ts",
output: {file: "dist/index.d.ts", format: "es"},
plugins: [dts()]
})
];