Make a build for production

When your application is ready to deploy, you should generate a build. This combines and minifies all javascript for the FontoXML platform with your application code into a single .js file, and bundles all assets in a single directory.

Installation procedure

The build tools should have been installed automatically at the same time when you set up the FontoXML development server. Please refer to the Getting up and running guide for installation details.

Building your application

For creating a production ready build of the FontoXML instance, you can use the following command from you instance's root directory:

fdt editor build

After this command is completed, you will see a dist directory in the root directory. This contains the optimized build of your instance. You can serve the build in your browser using the development server:

fdt editor run --dist

This command should run the development server in "dist mode", serving the packaged application rather than the source files.

Directory structure

The dist directory contains the following files:

assets This folder contains assets used by the application at run-time, such as schemas and images. These should be served from your CMS in a similar location relative to the index.html content.
index.html The HTML required to run the FontoXML editor. This can either be served directly from the CMS, or integrated in your templating solution. Make sure that you update this HTML whenever the editor is updated, as the contents may change depending on configuration and the FontoXML release being used.
main.js The bundled javascript for your FontoXML application, including the FontoXML platform, installed add-ons and your application code. Make sure this is served from the same path as the index.html content.
styles.css The bundled stylesheets for your FontoXML application. Make sure this is served from the same path as the index.html content.