-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
rollup.config.js
executable file
·100 lines (91 loc) · 2.09 KB
/
rollup.config.js
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// import babel from 'rollup-plugin-babel';
// import resolve from 'rollup-plugin-node-resolve';
// import commonjs from 'rollup-plugin-commonjs';
// import { terser } from 'rollup-plugin-terser';
import banner from 'rollup-plugin-banner2';
import json from '@rollup/plugin-json';
import shebang from 'rollup-plugin-shebang-bin';
import S from 'tiny-dedent';
import packageJson from './package.json';
const license = () => S(`
/*!
* ${packageJson.nameFull} v${packageJson.version} (${packageJson.homepage})
* Copyright (c) ${packageJson.author}
* @license ${packageJson.license}
*/
`
);
// const production = !process.env.ROLLUP_WATCH;
// const sourcemap = production ? true : 'inline';
// const entry = 'src/index.js';
// const assumptions = {
// constantSuper: true,
// enumerableModuleMeta: true,
// ignoreFunctionLength: true,
// ignoreToPrimitiveHint: true,
// noClassCalls: true,
// noDocumentAll: true,
// noNewArrows: true,
// privateFieldsAsProperties: true,
// setClassMethods: true,
// setComputedProperties: true,
// setPublicClassFields: true,
// };
const config = [
// Node script
{
input: 'src/cli.js',
output: [
{
file: packageJson.bin,
format: 'esm',
sourcemap: false,
//exports: 'default',
},
],
external: [/node_modules/],
browser: false,
plugins: [
// resolve({
// preferBuiltins: true,
// }),
//commonjs(),
json(),
// babel({
// assumptions,
// plugins: [
// ]
// }),
banner(license),
shebang(),
]
},
// GitHub Action
{
input: 'src/action.js',
output: [
{
file: packageJson.action,
format: 'esm',
sourcemap: false,
//exports: 'default',
},
],
external: [/node_modules/],
browser: false,
plugins: [
// resolve({
// preferBuiltins: true,
// }),
//commonjs(),
json(),
// babel({
// assumptions,
// plugins: [
// ]
// }),
banner(license)
]
},
];
export default config;