Skip to content

Commit

Permalink
Ref #47, #60 READMEを更新、CIもwasmが動くアプリケーションをWebpackでビルドするように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiyaowl committed Sep 14, 2019
1 parent 8dcd331 commit 1e146ca
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ jobs:
command: cd wasm && npm install && npm run build
- run:
name: Deploy to netlify
command: netlify deploy --prod -d ./wasm
command: netlify deploy --prod -d ./wasm/dist

29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,37 @@ NES Emulator written in Rust

---

## Build & Run (for Desktop)
## Build

```
rustc 1.37.0 required

### Desktop Application

```shell
$ cd desktop
$ cargo run --release
```

rustc 1.37.0 required
#### on Docker

## Build (on Docker)
```shell
$ docker-compose run build-desktop-release
```

### WebAssembly Application

```shell
$ cd wasm
$ wasm-pack build --release
$ npm install
$ npm run build
```
$ docker-compose run build-desktop-release
$ ./desktop/target/release/rust-nes-emulator-desktop

#### on Docker

```shell
$ docker-compose run build-wasm-release
$ docker-compose run build-wasm-webpage
```

## Test ROMs
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ services:
- ./:/work
working_dir: /work/wasm
command: wasm-pack build --release
# preview wasm at localhost:4444
serve-wasm:
image: nginx:latest
ports:
- "4444:80"
# build wasm webpage
build-wasm-webpage:
build: .
volumes:
- ./wasm:/usr/share/nginx/html
- ./:/work
working_dir: /work/wasm
command: npm run build
1 change: 1 addition & 0 deletions wasm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const dist = path.resolve(__dirname, "/dist");
module.exports = {
context: src,
entry: "./index.js",
mode: "production",
output: {
path: path.resolve(__dirname, "dist"),
filename: "index.js"
Expand Down

0 comments on commit 1e146ca

Please sign in to comment.