-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathrollup.config.js
executable file
·51 lines (46 loc) · 1.25 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
import buble from '@rollup/plugin-buble';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import url from '@rollup/plugin-url';
import minimist from 'minimist';
import scss from 'rollup-plugin-scss';
import { terser } from 'rollup-plugin-terser';
import vue from 'rollup-plugin-vue';
const argv = minimist(process.argv.slice(2));
const config = {
input: 'src/index.js',
output: {
name: 'VueNavigationBar',
exports: 'named',
globals: {
vue: 'Vue',
'vue-screen-size': 'VueScreenSize',
'tippy.js': 'tippy',
},
},
plugins: [
vue({
css: false,
compileTemplate: true,
}),
scss({ output: 'dist/vue-navigation-bar.css' }),
resolve({
jsnext: true,
main: true,
}),
commonjs(),
buble(),
url(),
],
external: ['vue', 'vue-screen-size', 'tippy.js'],
};
// Only minify browser (iife) version
if (argv.format === 'iife') {
config.plugins.push(terser());
// Here we remove our `external` dependency that we have in this project
// Be careful with the index here - it has to match any dependency that
// you want to be built into to the iife output
config.external.splice(1);
config.external.splice(1);
}
export default config;