generated from thedanchez/template-solidjs-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsup.config.ts
31 lines (26 loc) · 905 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
import { defineConfig } from "tsup";
import * as preset from "tsup-preset-solid";
const generateSolidPresetOptions = (): preset.PresetOptions => ({
entries: [
{
// entries with '.tsx' extension will have `solid` export condition generated
entry: "src/index.tsx",
dev_entry: false,
server_entry: false,
},
],
cjs: false,
});
export default defineConfig((config) => {
const watching = !!config.watch;
const solidPresetOptions = generateSolidPresetOptions();
const parsedOptions = preset.parsePresetOptions(solidPresetOptions, watching);
if (!watching) {
const packageFields = preset.generatePackageExports(parsedOptions);
preset.writePackageJson(packageFields);
}
const tsupOptions = preset
.generateTsupOptions(parsedOptions)
.map((tsupOption) => ({ name: "solid-plaid-link", minify: true, ...tsupOption }));
return tsupOptions;
});