-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.ts
46 lines (43 loc) · 1.06 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
import type { RollupOptions } from "rollup";
import { swc, defineRollupSwcOption } from "rollup-plugin-swc3";
import { typescriptPaths } from "rollup-plugin-typescript-paths";
import externals from "rollup-plugin-node-externals";
const config: RollupOptions =
// CommonJS (for Node) & ESM (for bundlers)
{
input: "src/index.ts",
output: [
{
file: "lib/index.js",
format: "cjs",
sourcemap: false,
},
{
file: "lib/index.mjs",
format: "es",
sourcemap: false,
},
// { file: pkg.main, format: 'cjs', sourcemap: false },
// { file: pkg.module, format: 'es', sourcemap: false },
],
plugins: [
typescriptPaths({ preserveExtensions: true }),
externals(),
swc(
defineRollupSwcOption({
minify: true,
tsconfig: "./tsconfig.build.json",
jsc: {
keepClassNames: true,
minify: {
mangle: false,
compress: true,
},
experimental: { keepImportAttributes: true },
},
}),
),
],
// external: ['oxide.ts', 'oxide.ts/dist/core', 'node:crypto'],
};
export default config;