forked from mistic100/Photo-Sphere-Viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
66 lines (62 loc) · 1.38 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
import alias from 'rollup-plugin-alias';
import babel from 'rollup-plugin-babel';
import { string } from 'rollup-plugin-string';
import pkg from './package.json';
const babelConfig = {
exclude: 'node_modules/**',
};
const banner = `/*!
* Photo Sphere Viewer ${pkg.version}
* @copyright 2014-2015 Jérémy Heleine
* @copyright 2015-${new Date().getFullYear()} Damien "Mistic" Sorel
* @licence MIT (https://opensource.org/licenses/MIT)
*/`;
export default [
{
input : 'src/js/index.js',
output : {
file : 'dist/photo-sphere-viewer.js',
name : 'PhotoSphereViewer',
format : 'umd',
sourcemap: true,
globals : {
'three' : 'THREE',
'uevent': 'uEvent'
},
banner : banner
},
external: [
'three',
'uevent'
],
plugins : [
babel(babelConfig),
string({
include: [
'src/icons/*.svg'
]
})
]
},
{
input : 'src/js/PhotoSphereViewerCompat.js',
output : {
file : 'dist/photo-sphere-viewer.compat.js',
name : 'PhotoSphereViewerCompat',
format : 'umd',
globals: {
'photo-sphere-viewer': 'PhotoSphereViewer'
},
banner : banner
},
external: [
'photo-sphere-viewer'
],
plugins : [
alias({
'photo-sphere-viewer': './src/js'
}),
babel(babelConfig)
]
}
];