Skip to content

Commit c601b4e

Browse files
authored
added minified versions of .module and .cjs, reduced build size by 50% (#25714)
1 parent 67feb9b commit c601b4e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

utils/build/rollup.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,22 @@ const builds = [
294294
}
295295
]
296296
},
297+
{
298+
input: 'src/Three.js',
299+
plugins: [
300+
addons(),
301+
glconstants(),
302+
glsl(),
303+
terser(),
304+
header()
305+
],
306+
output: [
307+
{
308+
format: 'esm',
309+
file: 'build/three.module.min.js'
310+
}
311+
]
312+
},
297313
{
298314
input: 'src/Three.js',
299315
plugins: [
@@ -310,6 +326,24 @@ const builds = [
310326
}
311327
]
312328
},
329+
330+
{
331+
input: 'src/Three.js',
332+
plugins: [
333+
addons(),
334+
glsl(),
335+
terser(),
336+
header()
337+
],
338+
output: [
339+
{
340+
format: 'cjs',
341+
name: 'THREE',
342+
file: 'build/three.min.cjs',
343+
indent: '\t'
344+
}
345+
]
346+
},
313347
{ // @deprecated, r150
314348
input: 'src/Three.js',
315349
plugins: [

0 commit comments

Comments
 (0)