Преглед на файлове

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

Adam Beili преди 2 години
родител
ревизия
c601b4e3c2
променени са 1 файла, в които са добавени 34 реда и са изтрити 0 реда
  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',
 		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
 		input: 'src/Three.js',
 		plugins: [