Skip to content

Commit

Permalink
Merge pull request #65 from Stremio/feat/wasm-build-improvement
Browse files Browse the repository at this point in the history
feat: add dev build and skip package.json creation
  • Loading branch information
elpiel committed Oct 24, 2023
2 parents 49d57bc + 91e398a commit 10858be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ Bridge between [stremio-core](https://github.com/stremio/stremio-core) and [stre

## Build

Builds a wasm package and prepares the rest of the dependencies for the npm package.
Builds a production wasm package and prepares the rest of the dependencies for the npm package.

```
npm install
npm run build
```

### Development

Building the package using [`./scripts/build.sh`](./scripts/build.sh) with `--dev` would allow you to see more logging messages being emitted, this is intended **only** for debugging as it will log messages with sensitive information!

```
./scripts/build.sh --dev
```

## Publishing

1. Update version to the next minor/major/patch version in Cargo (`Cargo.toml` and `Cargo.lock`) and npm (`package.json` and `package-lock.json`), e.g. from `0.44.13` to `0.44.14`.
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -ex
wasm-pack build --no-typescript --out-dir wasm_build --release --target web
MODE=${1:---release}
wasm-pack build --no-typescript --no-pack --out-dir wasm_build $MODE --target web
mv ./wasm_build/stremio_core_web_bg.wasm stremio_core_web_bg.wasm
npx babel wasm_build/stremio_core_web.js --config-file ./.babelrc --out-file stremio_core_web.js
npx babel src/bridge.js --config-file ./.babelrc --out-file bridge.js
Expand Down

0 comments on commit 10858be

Please sign in to comment.