-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrolldown.config.mjs
More file actions
62 lines (59 loc) · 1.24 KB
/
rolldown.config.mjs
File metadata and controls
62 lines (59 loc) · 1.24 KB
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
// @ts-check
const entries = [
{
input: 'ffl.js',
name: 'FFLjs',
outFile: 'dist/ffl.browser.js'
},
{
input: 'materials/FFLShaderMaterial.js',
name: 'FFLShaderMaterial',
outFile: 'dist/materials/FFLShaderMaterial.browser.js',
exports: 'default'
},
{
input: 'materials/LUTShaderMaterial.js',
name: 'LUTShaderMaterial',
outFile: 'dist/materials/LUTShaderMaterial.browser.js',
exports: 'default'
},
{
input: 'materials/SampleShaderMaterial.js',
name: 'SampleShaderMaterial',
outFile: 'dist/materials/SampleShaderMaterial.browser.js',
exports: 'default'
}
// No NodeMaterials for now as the WebGPURenderer is required.
];
const baseGlobals = { three: 'THREE' };
const baseExternal = ['three'];
/** Built Rollup configs for each entry in both minified and non-minified form. */
export default entries.flatMap(({ input, name, outFile, exports }) => [
// Unminified
{
input,
output: {
file: outFile,
format: 'iife',
name,
globals: baseGlobals,
exports
},
external: baseExternal
}
// Minified variant
/*
{
input,
output: {
file: outFile.replace(/\.js$/, '.min.js'),
format: 'iife',
name,
globals: baseGlobals,
exports,
},
external: baseExternal,
plugins: [terser()],
}
*/
]);