-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrollup.config.js
45 lines (43 loc) · 1.3 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
import vue from 'rollup-plugin-vue'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { getBabelOutputPlugin } from '@rollup/plugin-babel'
import eik from '@eik/rollup-plugin';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import pkg from './package.json';
const browsers = 'supports es6-module and > 2% in NO and not dead';
const commonPlugins = [
vue(),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
getBabelOutputPlugin({
presets: [['@babel/preset-env', { targets: browsers, bugfixes: true }]],
}),
nodeResolve(),
commonjs(),
terser(),
];
export default [
{ // local build
input: 'index.js',
output: { file: './dist/fabric-vue.js', format: 'es', exports: 'named', sourcemap: true },
plugins: commonPlugins,
external: ['vue', ...Object.keys(pkg.dependencies)]
},
{ // docs build
input: 'index.js',
output: { file: './dist/docs/fabric-vue.js', format: 'es', exports: 'named', sourcemap: true },
plugins: commonPlugins,
external: ['vue']
},
{ // eik build
input: 'index.js',
output: { file: './dist/eik/index.js', format: 'es', exports: 'named', sourcemap: true },
plugins: [
eik(),
...commonPlugins
]
}
]