File tree 1 file changed +7
-25
lines changed
1 file changed +7
-25
lines changed Original file line number Diff line number Diff line change @@ -24,37 +24,19 @@ micromamba create -n pyjs-build-env -f build-environment.yaml -y
24
24
micromamba activate pyjs-build-env
25
25
```
26
26
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 :
28
28
29
29
``` bash
30
- micromamba create -n pyjs-web-env --platform=emscripten-32 -f web-environment.yaml -y
30
+ python build.py
31
31
```
32
32
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.
34
35
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:
55
37
56
38
``` bash
57
- cp $MAMBA_ROOT_PREFIX /envs/pyjs-web-env/lib_js/pyjs/pyjs_runtime_browser.js .
39
+ python -m http.server --directory build
58
40
```
59
41
60
- Finally open the ` build/index.html ` file in your browser.
42
+ And open the REPL in your browser at http://localhost:8000 .
You can’t perform that action at this time.
0 commit comments