-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
34 lines (32 loc) · 892 Bytes
/
rollup.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
import path from "node:path"
import typescript from "@rollup/plugin-typescript"
import { fileURLToPath } from "node:url"
import { defineConfig } from "rollup"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import commonjs from "@rollup/plugin-commonjs"
import terser from "@rollup/plugin-terser"
import dts from "rollup-plugin-dts"
const __dirname = fileURLToPath(new URL(".", import.meta.url))
export default () =>
defineConfig([
{
input: "src/app.ts",
output: {
format: "es",
file: "build/index.js",
},
plugins: [
typescript({
tsconfig: path.resolve(__dirname, "tsconfig.json"),
}),
nodeResolve(),
commonjs(),
terser(),
],
},
{
input: "./build/types/src/app.d.ts",
output: [{ file: "build/index.d.ts", format: "es" }],
plugins: [dts()],
},
])