-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.ts
More file actions
77 lines (75 loc) · 2.21 KB
/
rollup.config.ts
File metadata and controls
77 lines (75 loc) · 2.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import path from "node:path";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
const input = "src/index.ts";
const outDir = "dist";
export default [
{
input,
output: [
{
name: 'Laika',
file: path.join(outDir, "laika.mjs"),
format: "esm",
sourcemap: true,
globals: {
vue: 'Vue'
}
},
{
name: 'Laika',
file: path.join(outDir, "laika.cjs"),
format: "cjs",
sourcemap: true,
exports: "named",
globals: {
vue: 'Vue'
}
},
{
name: 'Laika',
file: path.join(outDir, "laika.js"),
format: "umd",
sourcemap: true,
globals: {
vue: 'Vue'
}
},
],
plugins: [
resolve({ preferBuiltins: true }),
commonjs(),
typescript({ tsconfig: "./tsconfig.build.json" }),
terser()
],
external: ["vue"],
},
{
input: "src/vite/index.ts",
output: [
{ file: path.join(outDir, "vite.mjs"), format: "esm", sourcemap: true },
],
plugins: [
resolve({ preferBuiltins: true }),
commonjs(),
typescript({ tsconfig: "./tsconfig.build.json" }),
terser()
],
external: ["vite", "node:fs", "node:path", "node:url", "vue"],
},
{
input,
output: [{ file: path.join(outDir, "laika.d.ts"), format: "es" }],
plugins: [dts({ tsconfig: 'tsconfig.types.json' })],
external: ["vue"],
},
{
input: "src/vite/index.ts",
output: [{ file: path.join(outDir, "vite.d.ts"), format: "es" }],
plugins: [dts({ tsconfig: "tsconfig.types.json" })],
external: ["vite", "node:fs", "node:path", "node:url", "vue"],
}
];