forked from rotate-mark/vue-datocms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
58 lines (55 loc) · 1.07 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
54
55
56
57
58
import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import tsConfig from './tsconfig.json'
import pkgJson from './package.json'
const dist = 'dist'
const name = 'VueDatocms'
const globals = { 'vue-demi': 'VueDemi' }
const baseConfig = {
input: 'src/index.ts',
external: [...Object.keys(pkgJson.peerDependencies), ...Object.keys(pkgJson.dependencies)],
plugins: [
esbuild({
target: tsConfig.compilerOptions.target,
minify: false,
}),
],
}
export default [
{
input: baseConfig.input,
output: {
file: dist + '/index.d.ts',
},
plugins: [dts()],
},
{
...baseConfig,
output: {
file: dist + '/index.esm.js',
format: 'esm',
},
},
{
...baseConfig,
output: {
name,
globals,
file: dist + '/index.umd.js',
format: 'umd',
exports: 'named',
compact: true,
},
},
{
...baseConfig,
output: {
name,
globals,
file: dist + '/index.min.js',
format: 'iife',
exports: 'named',
compact: true,
},
},
]