-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (43 loc) · 1.2 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
import fs from 'fs';
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import prettier from 'rollup-plugin-prettier';
import json from '@rollup/plugin-json';
import packageJson from './package.json';
const license = fs.readFileSync('./LICENSE.md', { encoding: 'utf-8' });
let preamble = '#!/usr/bin/env node\n\n';
preamble +=
'/*! *****************************************************************************\n';
preamble += license;
preamble += `***************************************************************************** */\n`;
export default [
{
input: './src/index.ts',
output: [{ file: packageJson.bin['i18n-cli'], format: 'cjs' }],
external: [
...Object.keys(packageJson.peerDependencies ?? {}),
'fs',
'path',
],
plugins: [
json(),
typescript({
tsconfigOverride: { exclude: ['**/*.test.ts'] },
}),
terser({
compress: false,
mangle: false,
format: {
comments: false,
preamble,
},
}),
prettier({
parser: 'babel',
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
}),
],
},
];