forked from johndatserakis/vue-cookie-accept-decline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·44 lines (39 loc) · 1.09 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
import { terser } from 'rollup-plugin-terser';
import buble from 'rollup-plugin-buble';
import commonjs from 'rollup-plugin-commonjs';
import minimist from 'minimist';
import resolve from 'rollup-plugin-node-resolve';
import scss from 'rollup-plugin-scss';
import vue from 'rollup-plugin-vue';
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: [
vue({
css: false,
compileTemplate: true,
}),
scss({ output: 'dist/vue-cookie-accept-decline.css' }),
resolve(),
buble(),
commonjs(),
],
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;