-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
53 lines (51 loc) · 1.2 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 vue from 'rollup-plugin-vue';
import alias from '@rollup/plugin-alias';
import del from 'rollup-plugin-delete';
import commonjs from '@rollup/plugin-commonjs';
import esbuild from 'rollup-plugin-esbuild';
import resolve from '@rollup/plugin-node-resolve';
import path from 'path';
const plugins = [
del({ targets: 'dist/*' }),
alias({
entries: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
}),
resolve(),
commonjs(),
vue(),
esbuild({
target: 'es2017',
minify: true,
}),
];
export default [
{
input: 'src/index.js',
output: [
{
name: 'vue-2-boring-avatars',
file: 'dist/vue-2-boring-avatars.es.js',
format: 'esm',
globals: { vue: 'Vue' },
sourcemap: true,
},
{
name: 'vue-2-boring-avatars',
file: 'dist/vue-2-boring-avatars.common.js',
format: 'cjs',
exports: 'auto',
globals: { vue: 'Vue' },
sourcemap: true,
},
{
name: 'vue-2-boring-avatars',
file: 'dist/vue-2-boring-avatars.umd.js',
format: 'umd',
globals: { vue: 'Vue' },
sourcemap: true,
},
],
plugins,
external: ['vue'],
},
];