builds.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst">Edit me on GitHub</a></div>
  3. .. _builds:
  4. ===============
  5. Creating builds
  6. ===============
  7. .. contents:: Table of Contents
  8. :depth: 3
  9. :local:
  10. .. warning:: There current documentation in this section does not adequately
  11. explain how to create custom builds.
  12. .. note:: Please make sure to read the section :doc:`development` and that you have installed
  13. all development dependencies (long story short, you should be able to just run ``make dev``)
  14. Creating builds
  15. ===============
  16. We use `require.js <http://requirejs.org>`_ to keep track of *Converse.js* and
  17. its dependencies and to to bundle them together in a single file fit for
  18. deployment to a production site.
  19. To create the bundles, simply run::
  20. make build
  21. This command does the following:
  22. * It creates different Javascript bundles of Converse.js.
  23. The individual javascript files will be bundled and minified with `require.js`_'s
  24. optimization tool, using `almond <https://github.com/jrburke/almond>`_.
  25. You can `read more about require.js's optimizer here <http://requirejs.org/docs/optimization.html>`_.
  26. * It bundles the HTML templates in ``./src/templates/`` into a single file called ``templates.js``.
  27. This file can then be included via the ``<script>`` tag. See for example the ``non_amd.html`` example page.
  28. * It bundles all the translation files in ``./locale/`` into a single file ``locales.js``.
  29. This file can then be included via the ``<script>`` tag. See for example the ``non_amd.html`` example page.
  30. * Also, the CSS files in the ``./css`` directory will be minified.
  31. The built Javasript bundles are contained in the ``./builds`` directory:
  32. .. code-block:: bash
  33. jc@conversejs:~/converse.js (master)$ ls builds/
  34. converse.js converse-no-locales-no-otr.js converse.website.min.js
  35. converse.min.js converse-no-locales-no-otr.min.js converse.website-no-otr.min.js
  36. converse.nojquery.js converse-no-otr.js locales.js
  37. converse.nojquery.min.js converse-no-otr.min.js templates.js
  38. .. _`minification`:
  39. Minifying the CSS
  40. -----------------
  41. To only minify the CSS files, nothing else, run the following command::
  42. make cssmin
  43. The CSS files are minified via `cssmin <https://github.com/gruntjs/grunt-contrib-cssmin>`_.