forked from MapComplete/MapComplete
		
	Create assets file
This commit is contained in:
		
							parent
							
								
									dc2d900b9a
								
							
						
					
					
						commit
						cfb064f400
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		|  | @ -6,18 +6,27 @@ echo "Starting build.Should" | ||||||
| rm -rf dist/* | rm -rf dist/* | ||||||
| rm -rf .cache | rm -rf .cache | ||||||
| mkdir dist 2> /dev/null | mkdir dist 2> /dev/null | ||||||
|  | mkdir dist/assets 2> /dev/null | ||||||
| 
 | 
 | ||||||
| # Copy the layer files, as these might contain assets (e.g. svgs) | # Copy the layer files, as these might contain assets (e.g. svgs) | ||||||
| cp -r assets/layers/ dist/assets/layers/ | cp -r assets/layers/ dist/assets/layers/ | ||||||
| cp -r assets/themes/ dist/assets/themes/ | cp -r assets/themes/ dist/assets/themes/ | ||||||
| cp -r assets/svg/ dist/assets/svg/ | cp -r assets/svg/ dist/assets/svg/ | ||||||
|  | echo "\n\n   Building non-theme pages" | ||||||
|  | echo "  ==========================\n\n" | ||||||
| parcel build --no-source-maps --public-url ./ "index.html" "404.html" "professional.html" "automaton.html" "land.html" "customGenerator.html" "theme.html" vendor | parcel build --no-source-maps --public-url ./ "index.html" "404.html" "professional.html" "automaton.html" "land.html" "customGenerator.html" "theme.html" vendor | ||||||
|  | echo "\n\n   Building theme pages" | ||||||
|  | echo "  ======================\n\n" | ||||||
| 
 | 
 | ||||||
| for file in $(ls index_*.ts) | for file in $(ls index_*.ts) | ||||||
| do | do | ||||||
|     theme=${file:6:-3} |     theme=${file:6:-3} | ||||||
|     echo $theme |     echo "\n\n  $theme" | ||||||
|  |     echo " ------------ \n\n" | ||||||
|     # Builds the necessary files for just one theme, e.g. 'bookcases.html' + 'index_bookcases.ts' + supporting file |     # Builds the necessary files for just one theme, e.g. 'bookcases.html' + 'index_bookcases.ts' + supporting file | ||||||
|     # npm run generate && node --max_old_space_size=12000 $(which parcel)  build  |     # npm run generate && node --max_old_space_size=12000 $(which parcel)  build  | ||||||
|     parcel build --no-source-maps --public-url ./ "$theme.html"  |     parcel build --no-source-maps --public-url ./ "$theme.html"  | ||||||
| done | done | ||||||
|  | 
 | ||||||
|  | # Optimize images | ||||||
|  | cd dist/ &&  find -name '*.png' -exec optipng '{}' \; && echo 'PNGs are optimized' | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue