-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
37 lines (36 loc) · 986 Bytes
/
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
import vue from 'rollup-plugin-vue';
import multiInput from 'rollup-plugin-multi-input';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from 'rollup-plugin-babel';
import cleaner from 'rollup-plugin-cleaner';
// Minimal rollup config
export default {
input: ['src/**/*.vue', 'src/**/*.js'],
output: {
format: 'esm',
dir: 'lib',
},
external(id) {
// Vue components must always be processed
if (/\.vue/.test(id)) return false;
// Every non-local file must be marked as external - don't include in bundle,
// let snowpack handle them instead.
if (!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/')) return true;
},
plugins: [
cleaner({
targets: [
'./lib/'
],
silent: false,
}),
multiInput(),
vue(),
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**' // only transpile our source code
}),
]
}