-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsup.config.ts
41 lines (38 loc) · 991 Bytes
/
tsup.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
import { Options, defineConfig } from "tsup";
const ENV = process.env.NODE_ENV;
const outDir = "dist";
const sourceMap = ENV === "development";
/**
* Need to experiment how customisable tsup is with build options
* Replace tsup with rollup if need arises
*/
export default defineConfig((options: Options) => {
return [
{
entry: ["src/components/**/*.ts?(x)", "!./**/*.stories.*"],
outDir: `${outDir}/components`,
format: ["esm"],
target: "es2015",
splitting: true,
sourcemap: sourceMap,
dts: true,
treeshake: true,
minify: true,
clean: true,
ignoreWatch: ["**/*.stories.*"]
},
{
entry: ["src/tokens/**/*.ts?(x)", "!./**/*.stories.*"],
outDir: `${outDir}/tokens`,
format: ["esm"],
target: "es2015",
splitting: true,
sourcemap: sourceMap,
dts: true,
treeshake: true,
minify: true,
clean: true,
ignoreWatch: ["**/*.stories.*"]
}
];
});