DevExtreme React - Create a Custom Bundle

To create a custom bundle using the DevExtreme Bundler tool, you need Webpack and the DevExtreme package installed globally.

  • npm install -g webpack
  • npm install -g devextreme

Create the DevExtreme configuration file in your project folder.

  • devextreme-bundler-init <bundle_name>

Here, is a name of the configuration file without an extension. By default, it is dx.custom.

After the file is created, you can edit it and leave only modules and exports you need.

NOTE
To use the DevExtreme widgets with the Knockout approach, check to ensure you use the Knockout integration module.
NOTE
To use the DevExtreme widgets with the AngularJS approach, check to ensure you use the AngularJS integration module.

The following command produces a minified bundle.

  • devextreme-bundler <bundle_name|file_name>

Then, link the bundle script file to your HTML page.

HTML
  • <script type="text/javascript" src="dx.custom.js" charset="utf-8"></script>

Link themes to your application.

HTML
  • <!--Link Themes-->
  • <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.18/css/dx.common.css" />
  • <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.18/css/dx.ios7.default.css" />

The example below demonstrates how to create an application with a single button using the modules and shows the reduced configuration file.