forked from pixijs-userland/lights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
63 lines (61 loc) · 1.58 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
import buble from 'rollup-plugin-buble';
import string from 'rollup-plugin-string';
import uglify from 'rollup-plugin-uglify';
import conditional from 'rollup-plugin-conditional';
import eslint from 'rollup-plugin-eslint';
import { minify } from 'uglify-es';
import pkg from './package.json';
const banner = [
'/*!',
` * ${pkg.name} - v${pkg.version}`,
` * Compiled ${(new Date()).toUTCString().replace(/GMT/g, 'UTC')}`,
' *',
` * ${pkg.name} is licensed under the MIT License.`,
' * http://www.opensource.org/licenses/mit-license',
' */',
].join('\n');
export default {
input: 'src/index.js',
output: [
{
name: 'PIXI.lights',
freeze: false,
file: pkg.main,
sourcemap: true,
format: 'umd',
banner
},
{
freeze: false,
file: pkg.module,
sourcemap: true,
format: 'es',
banner
},
],
plugins: [
eslint({
throwOnError: true,
include: 'src/**.js'
}),
string({
include: [
'**/*.frag',
'**/*.vert',
'**/*.glsl'
]
}),
buble(),
conditional(process.env.NODE_ENV !== 'development', [
uglify({
mangle: true,
compress: true,
output: {
comments: function(node, comment) {
return comment.line === 1;
}
}
}, minify)
])
]
};