Skip to content

Commit a6c4352

Browse files
committed
fix: remove tsup js file
1 parent 0189112 commit a6c4352

File tree

2 files changed

+8
-31
lines changed

2 files changed

+8
-31
lines changed

tsup.config.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

tsup.config.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import {defineConfig, type Options} from 'tsup';
21
import {readFile} from 'node:fs/promises';
2+
3+
import {defineConfig, type Options} from 'tsup';
4+
35
import {globalPackages as globalManagerPackages} from 'storybook/internal/manager/globals';
46
import {globalPackages as globalPreviewPackages} from 'storybook/internal/preview/globals';
57

6-
// The current browsers supported by Storybook v7
7-
const BROWSER_TARGET: Options['target'] = [
8-
'chrome100',
9-
'safari15',
10-
'firefox91',
11-
];
12-
const NODE_TARGET: Options['target'] = ['node18'];
8+
const NODE_TARGET: Options['target'] = 'node20';
139

1410
type BundlerConfig = {
1511
bundler?: {
@@ -48,7 +44,9 @@ export default defineConfig(async (options) => {
4844
minify: !options.watch,
4945
treeshake: true,
5046
sourcemap: true,
51-
clean: options.watch ? false : true,
47+
// keep this line commented until https://github.com/egoist/tsup/issues/1270 is resolved
48+
// clean: options.watch ? false : true,
49+
clean: false,
5250
};
5351

5452
const configs: Options[] = [];
@@ -64,8 +62,8 @@ export default defineConfig(async (options) => {
6462
resolve: true,
6563
},
6664
format: ['esm', 'cjs'],
67-
target: [...BROWSER_TARGET, ...NODE_TARGET],
6865
platform: 'neutral',
66+
target: NODE_TARGET,
6967
external: [...globalManagerPackages, ...globalPreviewPackages],
7068
});
7169
}
@@ -78,7 +76,6 @@ export default defineConfig(async (options) => {
7876
...commonConfig,
7977
entry: managerEntries,
8078
format: ['esm'],
81-
target: BROWSER_TARGET,
8279
platform: 'browser',
8380
external: globalManagerPackages,
8481
});
@@ -95,7 +92,6 @@ export default defineConfig(async (options) => {
9592
resolve: true,
9693
},
9794
format: ['esm', 'cjs'],
98-
target: BROWSER_TARGET,
9995
platform: 'browser',
10096
external: globalPreviewPackages,
10197
});
@@ -109,7 +105,6 @@ export default defineConfig(async (options) => {
109105
...commonConfig,
110106
entry: nodeEntries,
111107
format: ['cjs'],
112-
target: NODE_TARGET,
113108
platform: 'node',
114109
});
115110
}

0 commit comments

Comments
 (0)