-
Notifications
You must be signed in to change notification settings - Fork 752
Expand file tree
/
Copy pathrollup.config.js
More file actions
82 lines (78 loc) · 1.79 KB
/
rollup.config.js
File metadata and controls
82 lines (78 loc) · 1.79 KB
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
82
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import {createRequire} from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
const isWatch = process.env.ROLLUP_WATCH;
const banner = `/*!
* ${pkg.name} - ${pkg.description}
* ${pkg.homepage}
* Version: ${pkg.version}
*
* Copyright 2016-2026 Jerome Touffe-Blin
* Released under the ${pkg.license} license
* https://github.com/jtblin/angular-chart.js/blob/main/LICENSE
*/
`;
export default {
input: 'src/angular-chart.js',
output: [
{
file: 'dist/angular-chart.js',
format: 'umd',
name: 'angularChart',
banner,
sourcemap: true,
globals: {
'angular': 'angular',
'chart.js': 'Chart',
},
},
{
file: 'dist/angular-chart.min.js',
format: 'umd',
name: 'angularChart',
banner,
sourcemap: true,
plugins: [terser()],
globals: {
'angular': 'angular',
'chart.js': 'Chart',
},
},
{
file: 'dist/angular-chart.mjs',
format: 'es',
banner,
sourcemap: true,
globals: {
'angular': 'angular',
'chart.js': 'Chart',
},
},
{
file: 'dist/angular-chart.cjs.js',
format: 'cjs',
banner,
sourcemap: true,
globals: {
'angular': 'angular',
'chart.js': 'Chart',
},
},
],
external: ['angular', 'chart.js'],
plugins: [
resolve(),
commonjs(),
isWatch && serve({
contentBase: '',
port: 8080,
open: false,
}),
isWatch && livereload(['dist', 'examples']),
],
};