forked from inorganik/countUp.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
33 lines (33 loc) · 876 Bytes
/
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
import { terser } from 'rollup-plugin-terser';
/**
* Regarding "(!) `this` has been rewritten to `undefined`" warning:
* It occurs because of typescript's Object.assign polyfill, which uses
* `this` on the global scope. If you set `context: 'window'` in the rollup
* config, it will silence the warning, but it will cause issues if CountUp
* is not run in the browser. Allowing rollup to rewrite this to undefined
* on just the global scope is harmless and doesn't break anything.
*/
export default [
// minified build
{
input: 'dist/countUp.js',
output: {
file: 'dist/countUp.min.js',
},
plugins: [
terser(), // minify the output
],
},
// UMD build
{
input: 'dist/countUp.js',
output: {
file: 'dist/countUp.umd.js',
name: 'countUp',
format: 'umd',
},
plugins: [
terser(),
],
}
];