-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
34 lines (31 loc) · 863 Bytes
/
tsup.config.ts
File metadata and controls
34 lines (31 loc) · 863 Bytes
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
import { defineConfig } from 'tsup';
export default defineConfig({
target: 'esnext',
dts: {
resolve: true,
entry: ['./src/index.ts', './src/plugins/index.ts'],
},
keepNames: true,
entryPoints: ['./src/**/*.ts'],
clean: true,
format: 'esm',
splitting: true,
minify: false,
config: 'tsconfig.json',
external: ['uWebSockets.js'],
bundle: false,
plugins: [
{
name: 'fix-imports',
renderChunk(_, chunk) {
const code = chunk.code.replace(/from ['"](.*)['"]/g, (match, path) => {
if (path.startsWith('.') && !path.endsWith('.js')) {
return `from '${path}.js'`;
}
return match;
});
return { code };
},
},
],
});