-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
37 lines (35 loc) · 1006 Bytes
/
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
import strip from '@rollup/plugin-strip'
import ts from '@rollup/plugin-typescript'
import cleaner from 'rollup-plugin-cleaner'
import dts from 'rollup-plugin-dts'
import { del } from '@kineticcafe/rollup-plugin-delete'
const OUTPUT_DIR = './dist'
export default [{
input: './src/index.ts',
output: [{
dir: OUTPUT_DIR,
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
format: 'cjs',
sourcemap: false
}, {
dir: OUTPUT_DIR,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
format: 'es',
sourcemap: false
}],
plugins: [
cleaner({ targets: [OUTPUT_DIR] }),
ts({ compilerOptions: { outDir: OUTPUT_DIR, declarationDir: `${OUTPUT_DIR}/dts` } }),
strip()
],
external: ['live-connect-common', 'js-cookie']
}, {
input: `${OUTPUT_DIR}/dts/src/index.d.ts`,
output: [{ file: `${OUTPUT_DIR}/index.d.ts`, format: 'es' }],
plugins: [
dts(),
del({ targets: `${OUTPUT_DIR}/dts`, hook: 'buildEnd' })
]
}]