-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
50 lines (47 loc) · 948 Bytes
/
rollup.config.ts
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
46
47
48
49
50
import { defineConfig } from 'rollup';
import dts from 'rollup-plugin-dts';
import esbuild from 'rollup-plugin-esbuild';
import { PluginPure as pure } from 'rollup-plugin-pure';
const pluginPure = pure({
functions: ['defineComponent'],
});
const pluginDts = dts();
const externals = [
'@pansy/use-external',
];
export default defineConfig([
{
input: 'src/index.tsx',
plugins: [
esbuild({ target: 'es2018' }),
pluginPure,
],
external: [
...externals,
],
output: [
{
file: `dist/index.mjs`,
format: 'es',
},
{
file: `dist/index.cjs`,
format: 'cjs',
},
],
},
{
input: 'src/index.tsx',
plugins: [
pluginDts,
],
external: [
...externals,
],
output: [
{ file: `dist/index.d.cts` },
{ file: `dist/index.d.mts` },
{ file: `dist/index.d.ts` }, // for node10 compatibility
],
},
]);