Production Build

After authoring your Custom Application, you eventually want to deploy your application to a staging environment for testing purposes or to a production environment. One of the key steps to prepare your Custom Application for a deployment is creating a production build of your Custom Application.

This section helps prepare your Custom Application for deployment by creating a production build.


Before you get started, you need to do the following:

  • Configure your Custom Application.


To run the application in production mode, we need to build it using the following command:

mc-scripts build

Production build

The mc-scripts build command creates a dist/ directory containing all the generated JavaScript and CSS static assets. Most of the files are artifacts of the <ApplicationShell> due to Code-Splitting.

The command also generates a file named index.html.template. This file is generated by Webpack and contains references to the bundles, for example:

<!DOCTYPE html>
<html lang="en">
<link href="" rel='stylesheet' type='text/css' /></link>
<!-- other elements -->
<div id="app"></div>
<!-- other elements -->
<script src="__CDN_URL__runtime~app.47483a5f2f8fed96e937.js"></script>

The file index.html.template is very important and needs to be compiled into the index.html so that the Custom Application can be served on production.

Sign upLog inTech BlogIntegrationsStatusSupportUser Research Program
Copyright © 2021 commercetools
Privacy PolicyImprint