mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	build.sh: Detect local installs of rollup and improve error messages
This commit is contained in:
		
							parent
							
								
									0469252277
								
							
						
					
					
						commit
						0d8e317490
					
				
							
								
								
									
										24
									
								
								app/build.sh
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								app/build.sh
									
									
									
									
									
								
							@ -1,5 +1,27 @@
 | 
				
			|||||||
#! /bin/sh
 | 
					#! /bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd $(dirname $0)
 | 
					cd $(dirname $0)
 | 
				
			||||||
 | 
					if ! which wasm-pack > /dev/null 2>&1
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  >&2 echo '`wasm-pack` not found. Try running `cargo install wasm-pack`'
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wasm-pack build --target web
 | 
					wasm-pack build --target web
 | 
				
			||||||
rollup ./main.js --format iife --file ./pkg/bundle.js
 | 
					
 | 
				
			||||||
 | 
					ROLLUP_BIN=$(which rollup 2>/dev/null)
 | 
				
			||||||
 | 
					if [ -f ../node_modules/rollup/dist/bin/rollup ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  ROLLUP_BIN=../node_modules/rollup/dist/bin/rollup
 | 
				
			||||||
 | 
					elif [ -f node_modules/rollup/dist/bin/rollup ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  ROLLUP_BIN=node_modules/rollup/dist/bin/rollup
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z "$ROLLUP_BIN" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  >&2 echo '`rollup` not found. Try running `npm install rollup`'
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$ROLLUP_BIN ./main.js --format iife --file ./pkg/bundle.js
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user