Skip to content

Commit d337117

Browse files
committed
Update README
1 parent d370405 commit d337117

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

README.md

+7-25
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,19 @@ micromamba create -n pyjs-build-env -f build-environment.yaml -y
2424
micromamba activate pyjs-build-env
2525
```
2626

27-
Now create a new environment that will include the dependencies for running the REPL in the browser:
27+
In the environment, run the build script:
2828

2929
```bash
30-
micromamba create -n pyjs-web-env --platform=emscripten-32 -f web-environment.yaml -y
30+
python build.py
3131
```
3232

33-
Create a new build directory and configure the build:
33+
This create a new environment that will include the dependencies for running the REPL in the browser (runtime).
34+
The script also copies the relevant files to the `build` folder.
3435

35-
```bash
36-
mkdir build
37-
cd build
38-
```
39-
40-
Pack the environment:
41-
42-
```bash
43-
empack pack env --env-prefix $MAMBA_ROOT_PREFIX/envs/pyjs-web-env
44-
```
45-
46-
This will generate a list of `.tar.gz` files in the `build` directory.
47-
48-
Now copy the HTML and JavaScript files from the `page` directory to the `build` directory:
49-
50-
```bash
51-
cp ../page/* .
52-
```
53-
54-
You will also need to copy the browser runtime from the `pyjs-web-env` environment to the `build` directory:
36+
You can then start an HTTP server to serve the files in the `build` folder:
5537

5638
```bash
57-
cp $MAMBA_ROOT_PREFIX/envs/pyjs-web-env/lib_js/pyjs/pyjs_runtime_browser.js .
39+
python -m http.server --directory build
5840
```
5941

60-
Finally open the `build/index.html` file in your browser.
42+
And open the REPL in your browser at http://localhost:8000.

0 commit comments

Comments
 (0)