Przeglądaj źródła

Remove minified builds. (#33893)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mrdoob 1 tydzień temu
rodzic
commit
8060e04e50

+ 1 - 1
.github/workflows/ci.yml

@@ -67,7 +67,7 @@ jobs:
       - name: Install dependencies
         run: npm ci
       - name: Build
-        run: npm run build-module
+        run: npm run build
 
       - name: === E2E testing ===
         run: xvfb-run -a npm run test-e2e

+ 5 - 0
.github/workflows/read-size.yml

@@ -37,6 +37,11 @@ jobs:
       - name: Read bundle sizes
         id: read-size
         run: |
+          # minify the builds to measure their size
+          npx terser build/three.module.js --module --compress --mangle --output build/three.module.min.js
+          npx terser build/three.webgpu.js --module --compress --mangle --output build/three.webgpu.min.js
+          npx terser build/three.webgpu.nodes.js --module --compress --mangle --output build/three.webgpu.nodes.min.js
+
           WEBGL_FILESIZE=$(stat --format=%s build/three.module.min.js)
           gzip -k build/three.module.min.js
           WEBGL_FILESIZE_GZIP=$(stat --format=%s build/three.module.min.js.gz)

+ 5 - 0
.github/workflows/report-size.yml

@@ -73,6 +73,11 @@ jobs:
       - name: Read sizes
         id: read-size
         run: |
+          # minify the builds to measure their size
+          npx terser build/three.module.js --module --compress --mangle --output build/three.module.min.js
+          npx terser build/three.webgpu.js --module --compress --mangle --output build/three.webgpu.min.js
+          npx terser build/three.webgpu.nodes.js --module --compress --mangle --output build/three.webgpu.nodes.min.js
+
           WEBGL_FILESIZE_BASE=$(stat --format=%s build/three.module.min.js)
           gzip -k build/three.module.min.js
           WEBGL_FILESIZE_BASE_GZIP=$(stat --format=%s build/three.module.min.js.gz)

Plik diff jest za duży
+ 0 - 5
build/three.core.min.js


Plik diff jest za duży
+ 0 - 5
build/three.module.min.js


Plik diff jest za duży
+ 0 - 5
build/three.tsl.min.js


Plik diff jest za duży
+ 0 - 5
build/three.webgpu.min.js


Plik diff jest za duży
+ 0 - 5
build/three.webgpu.nodes.min.js


+ 0 - 12
package.json

@@ -47,7 +47,6 @@
     "build": "rollup -c utils/build/rollup.config.js",
     "build-docs": "jsdoc -c utils/docs/jsdoc.config.json && npm run build-llms",
     "build-llms": "node utils/llms/build.js",
-    "build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
     "dev": "node utils/build/dev.js && node utils/server.js -p 8080",
     "preview": "node utils/build/preview.js",
     "lint-core": "eslint src",
@@ -108,16 +107,5 @@
     "puppeteer": "^25.0.0",
     "rollup": "^4.6.0",
     "turndown": "^7.2.2"
-  },
-  "jspm": {
-    "files": [
-      "package.json",
-      "LICENSE",
-      "README.md",
-      "build/three.js",
-      "build/three.min.js",
-      "build/three.module.js"
-    ],
-    "directories": {}
   }
 }

+ 1 - 62
utils/build/rollup.config.js

@@ -1,4 +1,3 @@
-import terser from '@rollup/plugin-terser';
 import MagicString from 'magic-string';
 
 function glsl() {
@@ -120,67 +119,7 @@ const builds = [
 			}
 		],
 		external: [ 'three/webgpu' ]
-	},
-	{
-		input: {
-			'three.core.min.js': 'src/Three.Core.js',
-			'three.webgpu.nodes.min.js': 'src/Three.WebGPU.Nodes.js',
-		},
-		plugins: [
-			glsl(),
-			header(),
-			terser()
-		],
-		preserveEntrySignatures: 'allow-extension',
-		output: [
-			{
-				format: 'esm',
-				dir: 'build',
-				minifyInternalExports: false,
-				entryFileNames: '[name]',
-			}
-		]
-	},
-	{
-		input: {
-			'three.core.min.js': 'src/Three.Core.js',
-			'three.module.min.js': 'src/Three.js',
-			'three.webgpu.min.js': 'src/Three.WebGPU.js',
-		},
-		plugins: [
-			glsl(),
-			header(),
-			terser()
-		],
-		preserveEntrySignatures: 'allow-extension',
-		output: [
-			{
-				format: 'esm',
-				dir: 'build',
-				minifyInternalExports: false,
-				entryFileNames: '[name]',
-			}
-		]
-	},
-	{
-		input: {
-			'three.tsl.min.js': 'src/Three.TSL.js'
-		},
-		plugins: [
-			header(),
-			terser()
-		],
-		preserveEntrySignatures: 'allow-extension',
-		output: [
-			{
-				format: 'esm',
-				dir: 'build',
-				minifyInternalExports: false,
-				entryFileNames: '[name]',
-			}
-		],
-		external: [ 'three/webgpu' ]
 	}
 ];
 
-export default ( args ) => args.configOnlyModule ? builds.slice( 0, 3 ) : builds;
+export default builds;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików

粤ICP备19079148号