devextreme-react icon indicating copy to clipboard operation
devextreme-react copied to clipboard

Tree-shaking support

Open ovchinnikov opened this issue 7 years ago • 2 comments

Issue Type

bug report

Steps to Reproduce

  • create a new app npx create-react-app my-app
  • add DevExtreme Button:
import { Button } from 'devextreme-react';
...
render() {
    return (
        <Button text='Example Button' />
    );
 }

  • build project npm run build

Current Behavior

The resulting bundle contains all DevExtreme widgets. The total bundle size is about 3MB.

Expected Behavior

The resulting bundle should contain only the dxButton widget

ovchinnikov avatar May 04 '18 10:05 ovchinnikov

Hi! To decrease your bundle size, use the long path to import the DevExtreme Button.

import { Button } from "devextreme-react/ui/button";

We will investigate tree-shaking support in future versions to resolve your issue.

lukyanovas avatar Aug 06 '18 12:08 lukyanovas

We're going to deliver a set of ES6 modules starting with v20.2, see https://github.com/DevExpress/DevExtreme/issues/14351 for more details.

IlyaKhD avatar Aug 24 '20 14:08 IlyaKhD