-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathtsup.config.ts
More file actions
30 lines (29 loc) · 781 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
30 lines (29 loc) · 781 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
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts', 'src/demucs.ts'],
format: ['esm', 'cjs'],
dts: true,
clean: true,
sourcemap: true,
treeshake: false,
splitting: false,
outDir: 'dist',
outExtension({ format }) {
// Package has "type": "module", so bare .js is parsed as ESM by Node.
// Emit CJS as .cjs to avoid the "module is not defined in ES module scope"
// error that CJS consumers were hitting (see GH #192 follow-up).
return {
js: format === 'esm' ? '.mjs' : '.cjs',
};
},
target: 'es2020',
platform: 'browser',
minify: false,
shims: false,
noExternal: [],
esbuildOptions(options) {
options.platform = 'neutral';
},
bundle: true,
skipNodeModulesBundle: true,
});