Browse Source

added minified versions of .module and .cjs, reduced build size by 50% (#25714)

Adam Beili 2 years ago
parent
commit
c601b4e3c2
1 changed files with 34 additions and 0 deletions
  1. 34 0
      utils/build/rollup.config.js

+ 34 - 0
utils/build/rollup.config.js

@@ -294,6 +294,22 @@ const builds = [
 			}
 			}
 		]
 		]
 	},
 	},
+	{
+		input: 'src/Three.js',
+		plugins: [
+			addons(),
+			glconstants(),
+			glsl(),
+			terser(),
+			header()
+		],
+		output: [
+			{
+				format: 'esm',
+				file: 'build/three.module.min.js'
+			}
+		]
+	},
 	{
 	{
 		input: 'src/Three.js',
 		input: 'src/Three.js',
 		plugins: [
 		plugins: [
@@ -310,6 +326,24 @@ const builds = [
 			}
 			}
 		]
 		]
 	},
 	},
+
+	{
+		input: 'src/Three.js',
+		plugins: [
+			addons(),
+			glsl(),
+			terser(),
+			header()
+		],
+		output: [
+			{
+				format: 'cjs',
+				name: 'THREE',
+				file: 'build/three.min.cjs',
+				indent: '\t'
+			}
+		]
+	},
 	{ // @deprecated, r150
 	{ // @deprecated, r150
 		input: 'src/Three.js',
 		input: 'src/Three.js',
 		plugins: [
 		plugins: [