-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
33 lines (30 loc) · 825 Bytes
/
rollup.config.js
File metadata and controls
33 lines (30 loc) · 825 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
33
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import dts from 'rollup-plugin-dts';
import filesize from 'rollup-plugin-filesize';
import { readFileSync } from 'fs';
// Load package.json using fs instead of import assertions
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'));
const banner = `//! ${pkg.name} v${pkg.version} - ${pkg.homepage} - @license: ${pkg.license}`;
export default [
{
input: 'src/index.ts',
output: [
{
file: 'dist/toml-patch.js',
format: 'es',
banner
}
],
plugins: [typescript(), terser(), filesize()]
},
{
input: 'src/index.ts',
output: {
file: 'dist/toml-patch.d.ts',
format: 'es',
banner
},
plugins: [dts()]
}
];