-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
62 lines (59 loc) · 1.29 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @description
* @author 阿怪
* @date 2022/11/17 02:03
* @version v1.0.0
*
* 江湖的业务千篇一律,复杂的代码好几百行。
*/
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const buildBaseConfig = {
plugins: [typescript(), json()],
};
export default [
{
...buildBaseConfig,
input: 'config/eslint.config.ts',
output: [{
sourcemap: true,
file: 'dist/eslint.cjs',
format: 'cjs',
}],
},
{
...buildBaseConfig,
input: 'config/eslint/nuxt.eslint.config.ts',
output: [{
sourcemap: true,
file: 'dist/nuxt.eslint.cjs',
format: 'cjs',
}],
},
{
...buildBaseConfig,
input: 'config/commitlint.config.ts',
output: [{
sourcemap: true,
file: 'dist/commitlint.cjs',
format: 'cjs',
}],
},
{
input: 'lib/bin/jhlint.ts',
output: [{
sourcemap: true,
file: 'dist/bin/jhlint.mjs',
}],
external: [
'eslint', 'chalk', 'husky',
'@janghood/config',
'fs', 'path', 'child_process',
],
plugins: [
typescript(), json(), nodeResolve(), commonjs({ ignoreDynamicRequires: true }),
],
},
];