webserver.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/webserver.rst">Edit me on GitHub</a></div>
  3. .. _`webserver`:
  4. Setting up a webserver
  5. ======================
  6. When making changes to Converse, either development or theming changes,
  7. you'll want to preview them in your browser.
  8. For this, you'll need to serve the development files via a web server,
  9. so that you can see your local changes in the browser.
  10. Manually starting a web server
  11. ------------------------------
  12. To both set up the development environment and also start up a web browser to
  13. serve the files for you, you can run::
  14. make serve
  15. .. note::
  16. To run the "make" commands, you'll need `GNUMake <https://www.gnu.org/software/make>`_
  17. installed on your computer. If you use GNU/Linux or \*BSD, it should be installed or
  18. available via your package manager. For Mac, you'll need to install XCode and in
  19. Windows you can use `Chocolatey <https://chocolatey.org/>`_.
  20. After running ``make serve`` you can open http://localhost:8000 in your webbrowser to see the Converse website.
  21. When developing or changing the theme, you'll want to load all the
  22. unminified JS and CSS resources as separate files. To do this, open http://localhost:8000/dev.html instead.
  23. You might want to open `dev.html <https://github.com/conversejs/converse.js/blob/master/dev.html>`_ in your text editor or IDE as well, to see
  24. how ``converse.initialize`` is called and to potentially change any of the
  25. settings.
  26. If you're running ``make devserver``, you need to open http://localhost:8080
  27. instead.
  28. Starting a web server with live reloading
  29. -----------------------------------------
  30. Alternatively, if you want to have live reloading whenever any of the source files change, you
  31. can run ``make devserver`` (which will use `webpack-dev-server <https://github.com/webpack/webpack-dev-server>`_).
  32. Instead of ``dev.html`` being used, `webpack.html <https://github.com/conversejs/converse.js/blob/master/webpack.html>`_
  33. is now being used as the HTML template, and you'll need to modify that file if
  34. you want to change the settings passed to ``converse.initialize``.