Add npm/react-tools COMPRESS_PRECOMPILERS example

This commit is contained in:
Carlton Gibson
2015-07-10 14:53:59 +02:00
parent 6b7b6aa0a9
commit 75aff51661

View File

@@ -3,7 +3,20 @@
Facebook React Support
======================
Compiling React's jsx files can be done by creating a custom precompressor.
Assuming you have `npm` available by following the `react-tools installation instructions`_ and
adding an appropriate ``COMPRESS_PRECOMPILERS`` setting:
.. code-block:: django
COMPRESS_PRECOMPILERS = (
('text/jsx', 'cat {infile} | jsx > {outfile}'),
)
.. _react-tools installation instructions: http://facebook.github.io/react/docs/tooling-integration.html#productionizing-precompiled-jsx
If the above approach is not suitable for you, compiling React's jsx files can be done by creating
a custom precompressor.
Requirements
------------