-
Notifications
You must be signed in to change notification settings - Fork 20
/
rollup.config.mjs
41 lines (39 loc) · 1.06 KB
/
rollup.config.mjs
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
import typescript from '@rollup/plugin-typescript';
import preserveDirectives from 'rollup-preserve-directives';
import fs from 'fs';
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
export default [
{
input: 'src/index.ts',
external: Object.keys(pkg.peerDependencies || {}),
plugins: [
preserveDirectives(),
typescript({
sourceMap: false,
tsconfig: './tsconfig.json',
}),
],
output: [{ dir: 'dist', format: 'esm', preserveModules: true, preserveModulesRoot: 'src' }],
},
{
input: 'src/index.ts',
external: Object.keys(pkg.peerDependencies || {}),
plugins: [
preserveDirectives(),
typescript({
sourceMap: false,
tsconfig: './tsconfig.example-nextjs.json',
declarationDir: 'example-nextjs/src/react-component-lib',
}),
],
output: [
{
dir: 'example-nextjs/src/react-component-lib',
format: 'es',
banner: '/* eslint-disable */',
preserveModules: true,
preserveModulesRoot: 'src',
},
],
},
];