Fireplace/Compiling

From MozillaWiki
Jump to: navigation, search
Please do not edit this page unless you are on the Fireplace team. Your feedback and comments are welcomed on the discussion page.

This is a Beta Draft

Compiling

To run the compilation process, which compiles templates, CSS, and locale files, run the damper with the --compile argument: node damper.js --compile If you need to compile include files (i.e.: for Space Heater or a less HTTP- heavy version of the project), run make includes. This will generate two files: hearth/media/js/include.js
hearth/media/css/include.css
The CSS in include.css is generated in the order in which CSS files are included in hearth/index.html.

include.js uses a lightweight AMD loader (rather than require.js). This keeps file size down and also makes it possible to name-mangle internal keywords which otherwise wouldn't be minifiable. Note that the only safe globals are require and define---using any other non-browser globals will result in errors. I.e.: accessing _ without requiring 'underscore' will cause the code to fail. Also note that all modules must include a name as the first parameter.

Note that you need the dev dependencies to run this compilation. You can get them by running npm install -d.