vue-cookie-accept-decline
Version:
Show a banner with text, a decline button, and an accept button on your page.
49 lines (43 loc) • 1.29 kB
JavaScript
import vue from 'rollup-plugin-vue';
import css from 'rollup-plugin-css-only'
import buble from 'rollup-plugin-buble';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import minimist from 'minimist';
const argv = minimist(process.argv.slice(2));
const config = {
input: 'src/index.js',
output: {
name: 'VueCookieAcceptDecline',
exports: 'named',
globals: {
'vue': 'Vue',
'tiny-cookie': 'tinyCookie'
}
},
plugins: [
commonjs(),
resolve({
jsnext: true,
main: true,
browser: true,
}),
vue({
css: false,
compileTemplate: true,
}),
css({ output: 'dist/vue-cookie-accept-decline.css' }),
buble(),
],
external: ['vue', 'tiny-cookie']
};
// 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)
}
export default config;