Answers for "vue-sfc-rollup external dependency"

0

vue-sfc-rollup external dependency

// rollup.config.js
import vue from 'rollup-plugin-vue';
import buble from 'rollup-plugin-buble';
import uglify from 'rollup-plugin-uglify-es';
import minimist from 'minimist';

const argv = minimist(process.argv.slice(2));

const config = {
    input: 'src/index.js',
    output: {
        name: 'veeno',
        exports: 'named',
        globals: {                            // added
            noUiSlider: 'noUiSlider'
        }
    },
    external: ['nouislider'],          // added
    plugins: [
        vue({
            css: true,
            compileTemplate: true,
        }),
        buble(),
    ],
};

// Only minify browser (iife) version
if (argv.format === 'iife') {
    config.plugins.push(uglify());
}

export default config;
Posted by: Guest on January-27-2021

Code answers related to "vue-sfc-rollup external dependency"

Code answers related to "Javascript"

Browse Popular Code Answers by Language