-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
42 lines (41 loc) · 1004 Bytes
/
rollup.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
34
35
36
37
38
39
40
41
42
import { defineConfig } from 'rollup';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
export default defineConfig({
input: {
index: 'index.ts',
cli: 'src/cli.ts',
},
output: [
{
dir: 'dist',
format: 'cjs',
sourcemap: true,
entryFileNames: '[name].cjs', // 또는 [name].[format].js 같은 방식으로 설정 가능
exports: 'auto',
},
{
dir: 'dist',
format: 'es',
sourcemap: true,
entryFileNames: '[name].mjs',
exports: 'auto',
},
],
plugins: [
resolve(),
json(),
commonjs({
// CommonJS 모듈을 ESM으로 변환할 때 필요한 설정
include: 'node_modules/**',
}),
typescript({
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: 'dist/types',
exclude: ['node_modules/**'],
}),
],
});