Skip to main content

Generating a JSS app manifest file

Abstract

Overview of how JSS generates the manifest file

When you have defined all the code-first artifacts of your JSS application, such as routes, route types, placeholders, components, component content, and so on, you can generate a manifest that holds the complete manifest definition.

You can generate a JSS app manifest manually, by running the JSS CLI command jss manifest.

However, if you are not debugging the manifest generation process, it is more common that the manifest is generated automatically:

  • During the start-up of the disconnected development serve, usually by running the command jss start. The disconnected development server watches the folder sitecore/definitions and rebuilds the manifest when you add, remove or change manifest definitions.

  • During deployment or packaging of JSS artifacts to Sitecore using a JSS CLI command, when you use the JSS CLI commands jss deploy items or jss package. If you do not want to generate a manifest, you can use the --skipManifest argument.

By default, the JSS manifest in sample applications is emitted to the folder sitecore/manifest.

The manifest is generated with the following process:

  1. JSS locates all /sitecore/definitions/*.sitecore.{js|ts} manifest files in your application.

  2. JSS iterates over the manifest files, invoking the default export of each file. The default export is expected to be a function with the signature: function(manifest) { }.

  3. Each *.sitecore.{js|ts} file invokes various methods on the manifest instance received by the default function, such as addComponent or addRoute.

  4. After processing all *.sitecore.{js|ts} files, JSS generates the manifest output through a series of pipelines and writes the output to /sitecore/manifest or to the console, if you provide the parameter --manifestOutputPath console.

Note

The manifest generation process supports transpiled (ES6/TypeScript) manifest sources. In the sample apps, you can find the transpilers' default settings in /sitecore/definitions/config.js. You can override this path with the --require argument to the CLI command that generates the manifest.