From e2f54d31c98f8fbc3717837cd660a31a7c485b69 Mon Sep 17 00:00:00 2001 From: Marco Laponder Date: Wed, 25 Nov 2026 09:45:04 +0100 Subject: [PATCH] Add docs on building a release version of a pluggable widget --- .../extensibility/build-native-widget.md | 1 + ...a-release-version-of-a-pluggable-widget.md | 65 +++++++++++++++++++ .../create-a-pluggable-widget-one.md | 1 + .../create-content/create-widgets.md | 1 + 4 files changed, 68 insertions(+) create mode 100644 content/en/docs/howto/extensibility/pluggable-widgets/build-a-release-version-of-a-pluggable-widget.md diff --git a/content/en/docs/howto/extensibility/build-native-widget.md b/content/en/docs/howto/extensibility/build-native-widget.md index 8d2268f4237..c4f1325f6b6 100644 --- a/content/en/docs/howto/extensibility/build-native-widget.md +++ b/content/en/docs/howto/extensibility/build-native-widget.md @@ -1371,3 +1371,4 @@ The developer needs to have the class names memorized to apply a certain group b * [Designing Mobile User Interfaces](/refguide/mobile/designing-mobile-user-interfaces/) * [Native Mobile Styling Reference Guide](/refguide/native-styling-refguide/) * [How to Build Pluggable Widgets](/howto/extensibility/pluggable-widgets/) +* [Build a Release Version of a Pluggable Widget](/howto/extensibility/build-a-release-version-of-a-pluggable-widget/) diff --git a/content/en/docs/howto/extensibility/pluggable-widgets/build-a-release-version-of-a-pluggable-widget.md b/content/en/docs/howto/extensibility/pluggable-widgets/build-a-release-version-of-a-pluggable-widget.md new file mode 100644 index 00000000000..64895037fca --- /dev/null +++ b/content/en/docs/howto/extensibility/pluggable-widgets/build-a-release-version-of-a-pluggable-widget.md @@ -0,0 +1,65 @@ +--- +title: "Build a Release Version of a Pluggable Widget" +linktitle: "3. Release Pluggable Widget" +url: /howto/extensibility/build-a-release-version-of-a-pluggable-widget/ +weight: 30 +description: "Describes how to create a release build of a pluggable widget that you can bundle with a module or publish to the Marketplace." +--- + +## Introduction + +While you develop a pluggable widget, you 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. + +{{% alert color="warning" %}} +Do not distribute a development build. It includes source maps and unminified code, which makes the widget much larger and slower to load. Always use a release build for modules and Marketplace content. +{{% /alert %}} + +This how-to explains how a release build differs from a development build, how to create one, and how to find and test the result. It applies to both web and native pluggable widgets. + +## Prerequisites + +A pluggable widget created with the Pluggable Widget Generator. For more information, see [Build a Pluggable Web Widget: Part 1](/howto/extensibility/create-a-pluggable-widget-one/) or [Build a Pluggable Native Widget](/howto/extensibility/build-native-widget/). + +## 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 linting errors, and only creates the release build when no errors are found. + +If linting 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**: + +```text +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. + +{{% alert color="info" %}} +Copying the release build to your app requires Pluggable Widgets Tools 11.16.1 or above. With an earlier version, copy the *.mpk* file to the **widgets** folder of your app manually. For more information on updating, see [Update Pluggable Widgets Tools](/howto/extensibility/update-pluggable-widgets-tools/). +{{% /alert %}} + +## Testing the Release Build + +To test the release build in your app, do the following: + +1. In Studio Pro, synchronize the project directory by pressing F4, or select **App** > **Synchronize Project Directory**. +1. Run your app and verify that the widget works as expected. + +## Read More + +* [Build a Pluggable Web Widget: Part 1](/howto/extensibility/create-a-pluggable-widget-one/) +* [Build a Pluggable Native Widget](/howto/extensibility/build-native-widget/) +* [Update Pluggable Widgets Tools](/howto/extensibility/update-pluggable-widgets-tools/) +* [Pluggable Widgets API](/apidocs-mxsdk/apidocs/pluggable-widgets/) diff --git a/content/en/docs/howto/extensibility/pluggable-widgets/create-a-pluggable-widget-one.md b/content/en/docs/howto/extensibility/pluggable-widgets/create-a-pluggable-widget-one.md index 4e9fe259c8d..800ebffbb92 100644 --- a/content/en/docs/howto/extensibility/pluggable-widgets/create-a-pluggable-widget-one.md +++ b/content/en/docs/howto/extensibility/pluggable-widgets/create-a-pluggable-widget-one.md @@ -363,6 +363,7 @@ Continue with the next tutorial to learn how to add validation feedback, custom ## Read More * [Build a Pluggable Web Widget: Part 2 (Advanced)](/howto/extensibility/create-a-pluggable-widget-two/) +* [Build a Release Version of a Pluggable Widget](/howto/extensibility/build-a-release-version-of-a-pluggable-widget/) * [Pluggable Widgets API](/apidocs-mxsdk/apidocs/pluggable-widgets/) * [Client APIs Available to Pluggable Widgets](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/) * [Pluggable Widget Property Types](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/) diff --git a/content/en/docs/marketplace/manage-content/create-content/create-widgets.md b/content/en/docs/marketplace/manage-content/create-content/create-widgets.md index b533d7cadc1..c3cfc49fd3a 100644 --- a/content/en/docs/marketplace/manage-content/create-content/create-widgets.md +++ b/content/en/docs/marketplace/manage-content/create-content/create-widgets.md @@ -18,3 +18,4 @@ Follow these guidelines when developing widgets and submitting them to the Marke * A function should only do one thing, and do it properly. * Use hooks and functional components over class components. * Create test pages for mobile when content is made for mobile platforms. +* Submit a release build of the widget. For more information, see [Build a Release Version of a Pluggable Widget](/howto/extensibility/build-a-release-version-of-a-pluggable-widget/).