forked from haiiaaa/chartjs-gauge
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
68 lines (65 loc) · 1.28 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
const babel = require('rollup-plugin-babel');
const { terser } = require('rollup-plugin-terser');
const json = require('@rollup/plugin-json');
const pkg = require('./package.json');
const banner = `/*!
* chartjs-gauge.js v${pkg.version}
* ${pkg.homepage}
* (c) ${new Date().getFullYear()} chartjs-gauge.js Contributors
* Released under the MIT License
*/`;
const input = 'src/index.js';
const inputESM = 'src/index.esm.js';
const external = [
'chart.js',
'chart.js/helpers'
];
const globals = {
'chart.js': 'Chart',
'chart.js/helpers': 'Chart.helpers'
};
module.exports = [
// UMD builds (excluding Chart)
// dist/chartjs-gauge.js
// dist/chartjs-gauge.min.js
{
input,
plugins: [
babel({
exclude: 'node_modules/**',
}),
json(),
],
output: {
name: 'Gauge',
file: 'dist/chartjs-gauge.js',
banner,
format: 'umd',
indent: false,
globals
},
external
},
{
input,
plugins: [
babel({
exclude: 'node_modules/**',
}),
terser({
output: {
preamble: banner,
},
}),
json(),
],
output: {
name: 'Gauge',
file: 'dist/chartjs-gauge.min.js',
format: 'umd',
indent: false,
globals
},
external
},
];