Build a Pluggable Widget (Release Version)

Last modified: November 26, 2026

Introduction

While you develop a pluggable widget, you will regularly use npm start or npm run build. These commands create a development build, which is meant for testing. Before you bundle your widget with a module or publish it to the Mendix Marketplace, you need to create a release build.

This document explains how a release build differs from a development build, how to create a release build, and how to find and test your results. This document applies to both web and native pluggable widgets.

Prerequisites

Before starting this how-to, make sure you have completed the following prerequisites:

Differences Between a Development Build and a Release Build

Development build Release build
Source maps Included Not included
Code Not minified Minified and transpiled
Third-party dependency list Not included Included in the .mpk file as dependencies.txt and dependencies.json

Creating a Release Build

To create a release build, run npm run release in the root directory of your widget. This command first checks your code for formatting and linting errors, and only creates the release build when no errors are found.

If errors are reported, fix them and run npm run release again.

Finding the Release Build

The release build creates an .mpk file in the dist folder of your widget, in a subfolder named after the version in package.json:

dist/{version}/{packagePath}.{widgetName}.mpk

Use this .mpk file to publish your widget to the Marketplace or to include it in your module.

The release build also copies the .mpk file to the widgets folder of your Mendix app, the same way a development build does.

Testing the Release Build

To test the release build in your app, do the following:

  1. In Studio Pro, synchronize the app directory by pressing F4, or select App > Synchronize App Directory.
  2. Run your app and verify that the widget works as expected.

Read More