-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup-babel.config.mjs
94 lines (92 loc) · 2.03 KB
/
rollup-babel.config.mjs
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
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import { babel } from '@rollup/plugin-babel';
import { glconstants, glslThree, glsl } from './rollup-gl.mjs';
export default [
{
input: 'src/js/CV2.js',
output: [
{
name: 'CV2',
file: 'build/CaveView/js/CaveView2.babel.js',
format: 'umd'
},
{
name: 'CV2',
file: 'build/CaveView/js/CaveView2.babel.min.js',
format: 'umd',
plugins: [ terser() ]
}
],
plugins: [
glsl(),
glslThree(),
glconstants(),
json( {
exclude: [ 'node_modules/**', 'build/**', 'tools/**' ],
preferConst: true, // Default: false
} ),
nodeResolve( {} ),
commonjs( {
sourceMap: false, // Default: true
} ),
babel( { babelHelpers: 'runtime' } )
]
}, {
input: 'src/js/workers/webTileWorker.js',
output: [ {
file: 'build/CaveView/js/workers/webTileWorker.babel.js',
format: 'umd',
name: 'webTileWorker',
},
{
file: 'build/CaveView/js/workers/webTileWorker.babel.min.js',
format: 'umd',
name: 'webTileWorker',
plugins: [ terser() ]
} ],
plugins: [
nodeResolve( {} )
]
}, {
input: 'src/js/workers/webMeshWorker.js',
output: [
{
file: 'build/CaveView/js/workers/webMeshWorker.babel.js',
format: 'umd',
name: 'webMeshWorker'
}, {
file: 'build/CaveView/js/workers/webMeshWorker.babel.min.js',
format: 'umd',
name: 'webMeshWorker',
plugins: [ terser() ]
}
],
plugins: [
nodeResolve( {} ),
commonjs( {
include: 'node_modules/**', // Default: undefined
sourceMap: false, // Default: true
} )
]
}, {
input: 'src/js/workers/gltfWorker.js',
output: [
{
file: 'build/CaveView/js/workers/.babel.js',
name: 'gltfWorker',
format: 'umd'
}, {
file: 'build/CaveView/js/workers/gltfWorker.babel.min.js',
name: 'gltfWorker',
format: 'umd',
plugins: [ terser() ]
}
],
plugins: [
nodeResolve( {} )
]
}
];