mirror of
				https://github.com/taigrr/wasm-experiments
				synced 2025-01-18 04:03:21 -08:00 
			
		
		
		
	Fix tinygo JS example
This commit is contained in:
		
							parent
							
								
									6d867a75ab
								
							
						
					
					
						commit
						22573701f4
					
				
							
								
								
									
										1
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Makefile
									
									
									
									
									
								
							| @ -12,6 +12,7 @@ tinygo: clean | |||||||
| 		cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\
 | 		cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\
 | ||||||
| 	"
 | 	"
 | ||||||
| 	cp $$(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html | 	cp $$(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html | ||||||
|  | 	sed -i -e 's;</button>;</button>\n\t<div id=\"target\"></div>;' ./html/index.html | ||||||
| 
 | 
 | ||||||
| .PHONY: channels | .PHONY: channels | ||||||
| channels: clean | channels: clean | ||||||
|  | |||||||
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							| @ -38,13 +38,13 @@ serve as usual. For example: | |||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| $ make tinygo target=hello | $ make tinygo target=hello | ||||||
| rm -f ./html/* | docker run --rm -v $$(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments tinygo/tinygo:0.5.0 /bin/bash -c "\ | ||||||
| docker run --rm -v $(pwd):/go/src/github.com/johanbrandhorst/wasm-experiments --entrypoint /bin/bash tinygo/tinygo:latest -c "\ |  | ||||||
|         cd /go/src/github.com/johanbrandhorst/wasm-experiments && \ |         cd /go/src/github.com/johanbrandhorst/wasm-experiments && \ | ||||||
|         tinygo build -o ./html/test.wasm -target wasm ./hello/main.go && \ |         tinygo build -o ./html/test.wasm -target wasm --no-debug ./hello/main.go && \ | ||||||
|         cp /go/src/github.com/tinygo-org/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\ |         cp /usr/local/tinygo/targets/wasm_exec.js ./html/wasm_exec.js\ | ||||||
| " | " | ||||||
| cp $(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html | cp $$(go env GOROOT)/misc/wasm/wasm_exec.html ./html/index.html | ||||||
|  | sed -i -e 's;</button>;</button>\n\t<div id=\"target\"></div>;' ./html/index.html | ||||||
| $ make serve | $ make serve | ||||||
| go run main.go | go run main.go | ||||||
| 2019/02/24 14:33:58 Serving on http://localhost:8080 | 2019/02/24 14:33:58 Serving on http://localhost:8080 | ||||||
| @ -56,6 +56,7 @@ TinyGo: | |||||||
| 
 | 
 | ||||||
| - `hello` | - `hello` | ||||||
| - `channels` | - `channels` | ||||||
|  | - `js` | ||||||
| 
 | 
 | ||||||
| ## Experiments | ## Experiments | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user