-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtsup.config.js
More file actions
29 lines (26 loc) · 1.1 KB
/
tsup.config.js
File metadata and controls
29 lines (26 loc) · 1.1 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
import { defineConfig } from 'tsup';
export default defineConfig(async () => {
const commonConfig = {
splitting: true,
format: ['esm'],
treeshake: true,
// keep this line commented until https://github.com/egoist/tsup/issues/1270 is resolved
// clean: options.watch ? false : true,
clean: false,
// The following packages are provided by Storybook and should always be externalized
// Meaning they shouldn't be bundled with the addon, and they shouldn't be regular dependencies either
external: ['react', 'react-dom', '@storybook/icons'],
};
const configs = [
// manager entries are entries meant to be loaded into the manager UI
// they'll have manager-specific packages externalized and they won't be usable in node
// they won't have types generated for them as they're usually loaded automatically by Storybook
{
...commonConfig,
entry: ['src/manager.jsx'],
platform: 'browser',
target: 'esnext', // we can use esnext for manager entries since Storybook will bundle the addon's manager entries again anyway
},
];
return configs;
});