forked from ismail9k/vue3-carousel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
53 lines (50 loc) · 1.21 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import css from 'rollup-plugin-css-only'
import del from 'rollup-plugin-delete'
import dts from 'rollup-plugin-dts'
import { typescriptPaths } from 'rollup-plugin-typescript-paths'
import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json' assert { type: 'json' }
const banner = `/**
* Vue 3 Carousel ${pkg.version}
* (c) ${new Date().getFullYear()}
* @license MIT
*/`
export default [
{
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'umd',
name: 'VueCarousel',
banner,
globals: {
vue: 'Vue',
},
},
{
file: pkg.module,
format: 'es',
banner,
},
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [
css({ output: 'carousel.css' }),
typescript({ useTsconfigDeclarationDir: true }),
],
},
{
input: 'dist/dts/index.d.ts',
output: [{ file: 'dist/carousel.d.ts', format: 'es' }],
external: [/\.css$/],
plugins: [
typescriptPaths({ preserveExtensions: true }),
dts(),
del({ hook: 'buildEnd', targets: 'dist/dts', runOnce: true }),
],
},
]