diff --git a/Working-for-Web-(HTML5).md b/Working-for-Web-(HTML5).md
index 202e6d8..a23daa3 100644
--- a/Working-for-Web-(HTML5).md
+++ b/Working-for-Web-(HTML5).md
@@ -61,13 +61,52 @@ Generated `libraylib.a` is placed in `raylib\src\libraylib.a` directory.
#### Using CMake
-If you prefer to use `CMake` instead of the plain `Makefile` provided, just execute the following command:
+If you prefer to use `CMake` instead of the plain `Makefile` provided, you have a few options to choose from.
+
+##### Generating the build system files
+
+**You can go with the [emscripten suggested way](https://emscripten.org/docs/compiling/Building-Projects.html)**: That is to use the following command that will add the compiler and toolchain options for you:
+
+```
+emcmake cmake -H . -B build
+```
+_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
+
+Emscripten cmake will prefer the [ninja build system](https://ninja-build.org/) generator if you have that installed (and you should).
+
+**IDE-friendly option**: As the first option is only available from a command line where you have run "emsdk activate latest" when using an IDE (like Visual Studio, CLion, etc.) you should set the path to the emscripten toolchain file:
+
+```
+cmake -H . -B build -G Ninja "-DCMAKE_TOOLCHAIN_FILE=/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
+```
+_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
+_(The ninja generator is optional and you can use your system default by removing "-G Ninja".)_
+
+**The third option** is to use the lighter but included toolchain in raylib:
+
+```
+cmake -H . -B build -DPLATFORM=Web -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/emscripten.cmake
+```
+_(The "-H ." is deprecated since CMake 3.13 and if you are using higher version please replace the argument with "-S .")_
+_(The ninja generator is optional and you can use your system default by removing "-G Ninja".)_
+
+##### Building with CMake
+
+To build the project you would need to execute:
```
-cmake -H. -Bbuild -DPLATFORM=Web -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/emscripten.cmake
cmake --build build
```
+... but keep in mind that you also have to add some additional setting in your CMakeLists.txt for emscripten. For the linker to execute successfully it will need the GLFW symbols which cannot be built by you. Luckily emscripten provides those symbols when you add the "-s USE_GLFW=3" to your linker. To do so you can add these lines somewhere in the root of your CMakeLists.txt
+
+```cmake
+if (EMSCRIPTEN)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY")
+ set(CMAKE_EXECUTABLE_SUFFIX ".html") # This line is used to set your executable to build with the emscripten html template so taht you can directly open it.
+endif ()
+```
+
### Preparing your raylib game for web
To compile your game for web there are two possible scenarios:
@@ -115,13 +154,69 @@ To test the newly created `.html` file (and its .wasm, .js and .data), just crea
Create `localhost` using python, make sure you set the local host to the same folder where your `.html` file is located or keep in mind that the directory from which you set the localhost is the base directory for browser access.
-Using Python 2.7.x, create a localhost using:
+**Using Python 2.7.x**, create a localhost by creating the following script:
- python -m SimpleHTTPServer 8080
+```python
+# wasm-server.py
-Using Python 3.x, create a localhost using:
+import SimpleHTTPServer
+import SocketServer
- python3 -m http.server 8080
+class WasmHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
+ def end_headers(self):
+ # Include additional response headers here. CORS for example:
+ #self.send_header('Access-Control-Allow-Origin', '*')
+ SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
+
+
+# Python 3.7.5 adds in the WebAssembly Media Type. Version 2.x doesn't
+# have this so add it in.
+WasmHandler.extensions_map['.wasm'] = 'application/wasm'
+
+
+if __name__ == '__main__':
+ PORT = 8080
+ httpd = SocketServer.TCPServer(("", PORT), WasmHandler)
+ print("Listening on port {}. Press Ctrl+C to stop.".format(PORT))
+ httpd.serve_forever()
+```
+
+... and executing
+
+ python wasm-server.py
+
+**Using Python 3.x**, create a localhost using:
+
+```python
+# Python 3
+
+import sys
+import socketserver
+from http.server import SimpleHTTPRequestHandler
+
+class WasmHandler(SimpleHTTPRequestHandler):
+ def end_headers(self):
+ # Include additional response headers here. CORS for example:
+ #self.send_header('Access-Control-Allow-Origin', '*')
+ SimpleHTTPRequestHandler.end_headers(self)
+
+
+# Python 3.7.5 adds in the WebAssembly Media Type. If this is an older
+# version, add in the Media Type.
+if sys.version_info < (3, 7, 5):
+ WasmHandler.extensions_map['.wasm'] = 'application/wasm'
+
+
+if __name__ == '__main__':
+ PORT = 8080
+ with socketserver.TCPServer(("", PORT), WasmHandler) as httpd:
+ print("Listening on port {}. Press Ctrl+C to stop.".format(PORT))
+ httpd.serve_forever()
+```
+
+... and executing
+
+ python3 wasm-server.py
Finally, access your game in the browser using: