docs/developer/building_from_source.rst
.. code-block:: bash
git clone https://github.com/mlc-ai/web-llm.git cd web-llm
.. code-block:: bash
npm install
.. code-block:: bash
npm run build
To test your changes, you can reuse an existing example or create a new example that specifically tests the new functionality you wish to provide.
To test the effects of your code change in an example, inside examples/<example>/package.json, change "@mlc-ai/web-llm": "^0.2.xx" to "@mlc-ai/web-llm": "../.." to let it reference your local code. Note that sometimes you may need to switch between "file:../.." and "../.." to trigger npm to recognize new changes.
.. code-block:: bash
cd examples/<example>
npm install npm start