2015-05-02 01:21:25 +02:00
|
|
|
.. raw:: html
|
|
|
|
|
|
|
|
<div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst">Edit me on GitHub</a></div>
|
|
|
|
|
|
|
|
|
2015-02-05 15:58:51 +01:00
|
|
|
.. _builds:
|
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
=================
|
|
|
|
Generating builds
|
|
|
|
=================
|
2014-12-07 00:53:17 +01:00
|
|
|
|
|
|
|
.. contents:: Table of Contents
|
|
|
|
:depth: 3
|
|
|
|
:local:
|
|
|
|
|
|
|
|
|
|
|
|
.. warning:: There current documentation in this section does not adequately
|
2018-09-18 10:53:43 +02:00
|
|
|
explain how to create custom bundles.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
.. Note:: Please make sure to read the section :doc:`development` and that you have installed
|
2015-02-05 15:58:51 +01:00
|
|
|
all development dependencies (long story short, you should be able to just run ``make dev``)
|
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Creating JavaScript and CSS bundles and distribution files
|
|
|
|
==========================================================
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Converse uses `webpack <https://webpack.js.org/>`_ to create single build files containing the core code and
|
|
|
|
all of the 3rd party dependencies.
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
These files are in the `dist <https://github.com/conversejs/converse.js/tree/master/dist>`_ directory.
|
2016-09-23 10:54:55 +02:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Before you start changing the core code, you can run ``make watchjs`` in your terminal.
|
2016-09-23 10:54:55 +02:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
This command will listen for any changed files and then automatically create a
|
|
|
|
new build of ``dist/converse.js``.
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
The CSS files are also generated, from the scss files in the
|
|
|
|
`sass <https://github.com/conversejs/converse.js/tree/master/sass>`_ directory.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Similarly to ``make watchjs``, you can run ``make watch`` to automatically
|
|
|
|
generate the css files in the ``./css/`` directory.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
The Converse repository does not include the minified files in the ``dist`` or
|
|
|
|
``css`` directories. Before deployment, you'll want to generate them yourself.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
To do so, run the following:
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
::
|
|
|
|
make dist/converse.min.js
|
|
|
|
make css/converse.min.css
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Alternatively, if you want to generate ALL the bundles files (minified and
|
|
|
|
unminified), then you can also run::
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
make dist
|
2015-02-05 15:58:51 +01:00
|
|
|
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Creating custom bundles
|
|
|
|
=======================
|
2017-01-20 10:18:18 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
One reason you might want to create your own bundles, is because you want to
|
|
|
|
remove some of the core plugins of Converse, or perhaps you want to include
|
2017-01-20 10:18:18 +01:00
|
|
|
your own.
|
|
|
|
|
|
|
|
To add or remove plugins from the build, you need to modify the
|
2018-09-18 10:53:43 +02:00
|
|
|
`src/converse.js <https://github.com/conversejs/converse.js/blob/master/src/converse.js>`_ file.
|
2017-01-20 10:18:18 +01:00
|
|
|
|
|
|
|
You'll find a section marked ``/* START: Removable components`` and
|
|
|
|
``/* END: Removable components */``.
|
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
In this section is listed the Converse plugins that will make up a bundle.
|
2017-01-20 10:18:18 +01:00
|
|
|
|
|
|
|
You could for example decide to disable the ControlBox altogether by removing
|
|
|
|
the ``converse-controlbox`` plugin.
|
|
|
|
|
|
|
|
After doing so, you need to run ``make dist`` again in the root or your
|
2018-09-18 10:53:43 +02:00
|
|
|
Converse repository, in order to generate the new build.
|
2017-01-20 10:18:18 +01:00
|
|
|
|
|
|
|
Be aware that some plugins might have dependencies on other plugins, so if you
|
|
|
|
remove a certain plugin but other included plugins still depend on it, then it
|
|
|
|
will still be included in your build.
|
|
|
|
|
|
|
|
To see which other plugins a particular plugin depends on, open it up in your
|
|
|
|
text editor and look at the list specified as the second parameter to the
|
|
|
|
``define`` call, near the top of the file. This list specifies the dependencies
|
|
|
|
of that plugin.
|
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
Besides the standard build, the Converse repository includes configuration
|
|
|
|
for certain other non-standard builds, which we'll now mention below.
|
|
|
|
|
|
|
|
Excluding all 3rd party dependencies
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
The ``dist/converse-no-dependencies.js`` bundle contains only the core Converse
|
|
|
|
code and none of the 3rd party dependencies. This might be useful if you need
|
|
|
|
to load the dependencies separately.
|
|
|
|
|
|
|
|
To generate this bundle, you can run:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
make dist/converse-no-dependencies.js
|
|
|
|
make dist/converse-no-dependencies.min.js
|
|
|
|
|
|
|
|
Headless build
|
|
|
|
--------------
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
There is also the option of making a headless build of Converse.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
This is a build without any UI code but still containing the core functionality of
|
|
|
|
maintaining a roster, chats and messages.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
The file `src/headless.js <https://github.com/jcbrand/converse.js/blob/master/src/headless.js>`_
|
|
|
|
is used to determine which plugins are included in the build.
|
2014-12-07 00:53:17 +01:00
|
|
|
|
2018-09-18 10:53:43 +02:00
|
|
|
.. Note:: Unfortunately it's currently not yet possible to include Multi-user chat (MUC)
|
|
|
|
functionality in the headless build. This is because both the UI and core
|
|
|
|
functionality is still contained in one plugin and would first need to be
|
|
|
|
split up into two parts, with the UI part dropped for this build.
|