-
Notifications
You must be signed in to change notification settings - Fork 15
/
rollup.config.js
85 lines (83 loc) · 2.22 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import vue from 'rollup-plugin-vue';
import { terser } from 'rollup-plugin-terser';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import css from 'rollup-plugin-css-only';
import renameExtensions from '@betit/rollup-plugin-rename-extensions';
import nodeGlobals from 'rollup-plugin-node-globals';
const plugins = [
peerDepsExternal(),
css({ output: 'dist/bundle.css' }),
resolve({
extensions: ['.js', '.json', '.vue']
}),
commonjs(),
renameExtensions({
include: ['**/*.vue'],
mappings: { '.vue': '.vue.js' }
}),
vue({
css: false
}),
json()
];
export default [
{
input: 'src/index.js',
output: [
{
format: 'es',
dir: 'dist',
preserveModules: true,
preserveModulesRoot: 'src'
},
{
format: 'cjs',
file: 'dist/index.cjs.js'
}
],
plugins: [
...plugins,
babel({
babelHelpers: 'runtime',
exclude: 'node_modules/**',
plugins: ['@babel/plugin-transform-runtime']
})
],
external: [/@babel\/runtime/]
}, {
input: 'src/index.umd.js',
output: [
{
exports: 'named',
format: 'umd',
file: 'dist/index.min.js',
name: 'VueAtlaskit',
globals: {
vue: 'Vue'
}
}
],
plugins: [
...plugins,
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3
}
]
]
}),
nodeGlobals(),
terser()
]
}
];