Skip to content

Commit 5c3ef3e

Browse files
authored
Update README.md
1 parent 001c3f1 commit 5c3ef3e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ mp_js.do_str("print('hello world')\n");
1717

1818
Running with Webpack
1919
-----------------
20-
TODO
20+
Running MicroPython on Webpack is a little bit tricky. It expects the firmware.wasm file at /static/js/firmware.wasm. So a simple solution is to make static and js folder on webpack's public directory and put firmware.wasm on it. (PR is accepted for a better solution)
21+
22+
```
23+
mkdir -p public/static/js
24+
cp node_modules/micropython/lib/firmware.wasm public/static/js
25+
```
26+
27+
And import it on your Javascript file
28+
29+
```javascript
30+
import mp_js from 'micropython';
31+
mp_js.init(64 * 1024);
32+
mp_js.do_str("print('hello world')\n");
33+
```
2134

2235
API
2336
---

0 commit comments

Comments
 (0)