[Scripts > Minify] V2
This commit is contained in:
		
							parent
							
								
									913df50902
								
							
						
					
					
						commit
						a4491e4e19
					
				
					 2 changed files with 17 additions and 13 deletions
				
			
		
							
								
								
									
										16
									
								
								.github/workflows/release_nightly.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/release_nightly.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -40,18 +40,8 @@ jobs: | |||
| 
 | ||||
|     - name: Pack minified asar | ||||
|       run: | | ||||
|         npm i -g esbuild uglify-js minify-json | ||||
|         npx esbuild ./src --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=index.js | ||||
|         npx uglifyjs --compress --mangle -o index.js -- index.js | ||||
|         npx uglifyjs --compress --mangle -o preload.js -- src/splash/preload.js | ||||
|         npx uglifyjs --compress --mangle -o mainWindowInject.js -- src/mainWindowInject.js | ||||
|         cp src/package.json . | ||||
|         cp src/splash/index.html . | ||||
|         npx minify-json package.json | ||||
|         rm -rf src | ||||
|         mkdir src | ||||
|         cp index.js package.json index.html preload.js mainWindowInject.js src | ||||
|         npx asar pack src testing_dont_use.asar | ||||
|         npm i -g esbuild uglify-js minify-json html-minifier | ||||
|         bash scripts/minify.sh | ||||
| 
 | ||||
|     - name: GitHub Release | ||||
|       run: | | ||||
|  | @ -66,5 +56,5 @@ jobs: | |||
|         VERSION: 'nightly' | ||||
|         NAME: 'Nightly' | ||||
|         BODY: Latest Nightly release | ||||
|         FILES: app.asar testing_dont_use.asar | ||||
|         FILES: app.asar minified.asar | ||||
|         # FILES: app.asar | ||||
							
								
								
									
										14
									
								
								scripts/minify.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								scripts/minify.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| #!/bin/sh | ||||
| rm -rf miniSrc | ||||
| mkdir miniSrc | ||||
| npx esbuild ./src --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=miniSrc/index.js | ||||
| npx esbuild ./src/splash/preload.js --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=miniSrc/preload.js | ||||
| npx uglifyjs --compress --mangle -o miniSrc/index.js -- miniSrc/index.js | ||||
| npx uglifyjs --compress --mangle -o miniSrc/preload.js -- miniSrc/preload.js | ||||
| npx uglifyjs --compress --mangle -o miniSrc/mainWindowInject.js -- src/mainWindowInject.js | ||||
| npx html-minifier --collapse-whitespace --remove-comments --remove-script-type-attributes --remove-tag-whitespace --minify-css true --minify-js true -o miniSrc/index.html -- src/splash/index.html | ||||
| # cp src/splash/index.html miniSrc/ | ||||
| cp src/package.json miniSrc/package.json | ||||
| npx minify-json miniSrc/package.json | ||||
| npx asar pack miniSrc minified.asar | ||||
| # rm -rf miniSrc | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue