-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
130 lines (121 loc) · 2.81 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
const { terser } = require("rollup-plugin-terser");
const multi = require("@rollup/plugin-multi-entry");
const json = require("@rollup/plugin-json");
const pkg = require("./package.json");
function header() {
const banner = [
'// ##########################################',
'// OpenLIME - Open Layered IMage Explorer',
'// Author: CNR ISTI - Visual Computing Lab',
'// Author: CRS4 Visual and Data-intensive Computing Group',
`// ${pkg.name} v${pkg.version} - ${pkg.license} License`,
`// Documentation: ${pkg.homepage}`,
`// Repository: ${pkg.repository.url}`,
'// ##########################################'
].join('\n');
return {
renderChunk(code) {
return banner + "\n" + code;
}
};
}
const core = [
'./src/Util.js',
'./src/Canvas.js',
'./src/Camera.js',
'./src/Transform.js',
'./src/Colormap.js',
'./src/Layer.js',
'./src/LayerImage.js',
'./src/LayerCombiner.js',
'./src/LayerAnnotationImage.js',
'./src/LayerMaskedImage.js',
'./src/Tile.js',
'./src/Layout.js',
'./src/LayoutTiles.js',
'./src/LayoutTileImages.js',
'./src/Raster.js',
'./src/ShaderFilter.js',
'./src/ShaderFilterColormap.js',
'./src/ShaderFilterVector.js',
'./src/ShaderFilterVectorGlyph.js',
'./src/Shader.js',
'./src/ShaderCombiner.js',
'./src/ShaderEdgeDetection.js',
'./src/Controller.js',
'./src/Controller2D.js',
'./src/ControllerPanZoom.js',
'./src/PointerManager.js',
'./src/Viewer.js',
'./src/CoordinateSystem.js',
'./src/BoundingBox.js',
];
const ui = [
'./src/Skin.js',
'./src/UIBasic.js',
'./src/Ruler.js',
'./src/ScaleBar.js',
'./src/Draggable.js',
'./src/LightSphereController.js'
];
const lens = [
'./src/LayerLens.js',
'./src/ControllerLens.js',
'./src/FocusContext.js',
'./src/ControllerFocusContext.js',
'./src/LensDashboard.js',
'./src/LensDashboardNavigator.js',
'./src/LensDashboardNavigatorRadial.js',
];
const rti = [
'./src/LayerRTI.js',
'./src/ShaderRTI.js',
'./src/LayerNeuralRTI.js',
'./src/ShaderNeural.js'
];
const brdf = [
'./src/LayerBRDF.js',
'./src/ShaderBRDF.js'
];
const annotation = [
'./src/AudioPlayer.js',
'./src/TextToSpeechPlayer.js',
'./src/LayerAnnotation.js',
'./src/LayerSvgAnnotation.js',
'./src/EditorSvgAnnotation.js'
];
const allModules = [...core, ...ui, ...rti, ...brdf, ...lens, ...annotation];
module.exports = [
{
input: {
include: allModules,
},
output: [
{
format: 'umd',
name: 'OpenLIME',
file: 'dist/js/openlime.min.js',
plugins: [terser(), header()],
globals: {}
},
{
format: 'umd',
name: 'OpenLIME',
file: 'dist/js/openlime.js',
plugins: [header()],
globals: {}
},
{
format: 'es',
file: 'dist/js/openlime.esm.js',
plugins: [header()]
},
{
format: 'cjs',
file: 'dist/js/openlime.cjs.js',
plugins: [header()]
}
],
plugins: [multi(), json()]
}
];