forked from tardis-ksh/hexo-seo-submit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
36 lines (33 loc) · 844 Bytes
/
tsup.config.ts
File metadata and controls
36 lines (33 loc) · 844 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
35
36
import { defineConfig, type Options } from 'tsup';
import * as path from 'node:path';
const baseConfig: Partial<Options> = {
format: ['cjs'], // CommonJS
platform: 'node',
dts: false, // 生成 .d.ts 声明文件
sourcemap: false,
clean: true, // 构建前清理输出目录
minify: true, // 压缩代码
target: 'es6',
// splitting: false, // 禁用代码拆分
bundle: true, // 启用代码打包
splitting: true,
esbuildOptions: (options) => {
options.alias = {
'@': path.resolve(process.cwd(), 'src'),
};
},
treeshake: true,
onSuccess: 'cpx "src/handlebars/template/*" dist/handlebars/template',
};
export default defineConfig([
{
...baseConfig,
entry: ['src/index.ts'],
outDir: 'dist',
},
{
...baseConfig,
entry: ['src/bin/index.ts'],
outDir: 'dist/bin',
},
]);