forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tsup.config.ts
33 lines (30 loc) · 760 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
32
33
import * as path from 'node:path';
import fs from 'node:fs';
import { defineConfig } from 'tsup';
const pkgJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8'));
const licenseText = `/**
* ${pkgJson.name} v${pkgJson.version}
*
* @license ${pkgJson.license}
* This source code is licensed under the ${pkgJson.license} license found in the
* LICENSE file in the root directory of this source tree.
*/
`;
export default defineConfig({
entry: ['src/index.ts'],
outDir: 'build',
splitting: true,
sourcemap: true,
clean: true,
format: ['cjs', 'esm'],
treeshake: true,
cjsInterop: true,
dts: true,
silent: true,
banner: {
js: licenseText,
},
env: {
PACKAGE_NAME: pkgJson.name,
},
});