-
Notifications
You must be signed in to change notification settings - Fork 7
/
rollup.config.js
45 lines (44 loc) · 1.03 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
import { resolve } from 'path';
import postcss from 'rollup-plugin-postcss';
import { babel } from '@rollup/plugin-babel';
import extensions from 'rollup-plugin-extensions';
import { terser } from 'rollup-plugin-terser';
import url from 'postcss-url';
export default {
input: resolve(__dirname, './src/main.ts'),
output: [
{
file: resolve(__dirname, './es/main.esm.js'),
format: 'esm',
sourcemap: true,
},
{
file: resolve(__dirname, './es/main.esm.min.js'),
format: 'esm',
sourcemap: true,
plugins: [terser()],
},
],
external: ['vue', 'clipboard', 'tributejs', 'date-fns'],
plugins: [
babel({
babelHelpers: 'bundled',
extensions: ['.ts', '.tsx'],
}),
postcss({
extract: 'main.css',
sourceMap: true,
plugins: [
url({
url: 'copy',
useHash: true,
}),
],
to: resolve(__dirname, './es/main.css'),
}),
extensions({
extensions: ['.ts', '.tsx'],
resolveIndex: true,
}),
],
};