forked from yargs/yargs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.cjs
More file actions
32 lines (29 loc) · 769 Bytes
/
rollup.config.cjs
File metadata and controls
32 lines (29 loc) · 769 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
const cleanup = require('rollup-plugin-cleanup');
const ts = require('@wessberg/rollup-plugin-ts');
const {terser} = require('rollup-plugin-terser');
const output = {
format: 'cjs',
file: './build/index.cjs',
exports: 'default',
};
const plugins = [
ts(),
cleanup({
comments: 'none',
extensions: ['*'],
}),
];
if (process.env.NODE_ENV === 'test') {
// During development include a source map. We don't ship this to npm,
// because it significantly increases the module size:
output.sourcemap = true;
} else {
// Minify code when publishing, this significantly decreases the module
// size increased introduced by shipping both ESM and CJS:
plugins.push(terser());
}
module.exports = {
input: './lib/cjs.ts',
output,
plugins,
};