-
Notifications
You must be signed in to change notification settings - Fork 63
/
rollup.config.js
81 lines (79 loc) · 1.93 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import resolve from '@rollup/plugin-node-resolve';
import css from 'rollup-plugin-css-porter';
import filesize from 'rollup-plugin-filesize';
import sass from 'rollup-plugin-sass';
import typescript from 'rollup-plugin-typescript2';
import vue from 'rollup-plugin-vue';
import pkg from './package.json';
// Default configs
const name = 'VEmojiPicker';
const exports = 'named';
const sourcemap = false;
const globals = {
'vue-property-decorator': 'vuePropertyDecorator',
'vue-class-component': 'vueClassComponent'
};
export default {
input: 'src/index.ts', // our source file
inlineDynamicImports: true,
output: [
{
// Keep the bundle as an ES module file, suitable for other bundlers
// and inclusion as a <script type=module> tag in modern browsers
name,
file: pkg.module,
format: 'esm', // the preferred format
compact: true,
exports,
sourcemap
},
{
// A self-executing function, suitable for inclusion as a <script> tag.
// (If you want to create a bundle for your application, you probably want to use this.)
name,
file: pkg.unpkg,
format: 'iife',
compact: true,
exports,
sourcemap,
globals
},
{
// CommonJS, suitable for Node and other bundlers
name,
file: pkg.main,
format: 'cjs',
compact: true,
exports,
sourcemap,
globals
},
],
external: [
...Object.keys(pkg.dependencies)
],
plugins: [
typescript({
typescript: require('typescript'),
module: 'esnext',
check: false,
tsconfig: "tsconfig.json",
rollupCommonJSResolveHack: true,
tsconfigOverride: { exclude: ["node_modules", "src/main.ts", "tests"] }
}),
sass(),
css(),
vue({
css: true,
template: {
isProduction: true
}
}),
resolve({
extensions: ['.js', '.ts']
}),
filesize({
showBrotliSize: true
}),
]
};