forked from Nazariglez/pixi-tween
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrollup.config.js
51 lines (44 loc) · 1.09 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
import pkg from './package.json';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import { uglify } from 'rollup-plugin-uglify';
import { minify } from 'uglify-es';
const prod = process.env.BUILD === 'prod';
const format = process.env.FORMAT || 'umd';
const input = `src/index.js`;
const suffix = prod ? `.min` : '';
const suffixFormat = format !== 'umd' ? `.${format}` : '';
const file = `bin/pixi-tween${suffixFormat}${suffix}.js`;
const plugins = [
resolve(),
babel({
exclude: 'node_modules/**',
})
];
if (prod) {
plugins.push(uglify({
mangle: true,
compress: true,
}, minify));
}
const compiled = (new Date()).toUTCString().replace(/GMT/g, 'UTC');
const banner = `/*!
* ${pkg.name} - v${pkg.version}
* Compiled ${compiled}
*
* pixi-tween is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/\n`;
export default {
input,
output: {
name: '__pixiTween',
file,
format,
banner,
globals: `PIXI`,
intro: `if (typeof PIXI === 'undefined') { throw 'PixiJS is required'; }`,
sourcemap: false,
},
plugins
};