builds.rst 2.2 KB

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