showing results for - "vue sfc rollup external dependency"
Edoardo
25 Jan 2019
1// rollup.config.js
2import vue from 'rollup-plugin-vue';
3import buble from 'rollup-plugin-buble';
4import uglify from 'rollup-plugin-uglify-es';
5import minimist from 'minimist';
6
7const argv = minimist(process.argv.slice(2));
8
9const config = {
10    input: 'src/index.js',
11    output: {
12        name: 'veeno',
13        exports: 'named',
14        globals: {                            // added
15            noUiSlider: 'noUiSlider'
16        }
17    },
18    external: ['nouislider'],          // added
19    plugins: [
20        vue({
21            css: true,
22            compileTemplate: true,
23        }),
24        buble(),
25    ],
26};
27
28// Only minify browser (iife) version
29if (argv.format === 'iife') {
30    config.plugins.push(uglify());
31}
32
33export default config;
34