-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
32 lines (30 loc) · 882 Bytes
/
Copy pathrollup.config.js
File metadata and controls
32 lines (30 loc) · 882 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
import {terser} from 'rollup-plugin-terser';
import ts from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
import pkg from './package.json';
const variables = replace({
VERSION: JSON.stringify(pkg.version),
preventAssignment: true
});
export default [
{
input: 'src/cli/index.ts',
plugins: [ts(), variables],
external: ['commander', 'chalk', 'fs', 'path', 'glob', 'os', 'child_process', 'util'],
output: {
file: 'lib/cli.js',
format: 'es',
sourcemap: true
}
},
{
input: 'src/lib/index.ts',
plugins: [ts(), terser(), variables],
output: {
banner: `/*! Li18nt ${pkg.version} MIT | https://github.com/Simonwep/li18nt */`,
file: pkg.main,
format: 'es',
sourcemap: true
}
}
];