How do I use ES2015 Wijmo packages in Angular?

Posted by: stephen on 14 January 2021, 9:25 am EST

  • Posted 14 January 2021, 9:25 am EST - Updated 3 October 2022, 5:47 am EST

    Using the ES2015 version of the Wijmo packages will produce smaller bundles that when using ES5. I am trying to achieve this in Angular, but without success.

    In my Angular CLI 11 project I am using webpack-bundle-analyzer to inspect the build. It shows that the @angular package are ES2015 as expected (see attached image). But the @grapecity packages are the ES5 versions. So the compiler knows that it should prefer ES2015 packages, but somehow still selects the ES5 Wijmo packages.

    Why is this so, and what can I do to ensure the build uses the ES2105 Wijmo packages?

  • Posted 18 January 2021, 12:02 am EST

    Hi Stephen,

    We are extremely sorry for the delay in response.

    This seems like an issue in Wijmo so we have forwarded this to the developers with internal tracking id 470670 for further investigation.

    We also provide a way to change the module format using the mainFields property of webpack config. In the meantime, you can try this also:

    https://www.grapecity.com/wijmo/docs/GettingStarted/NPM-Module-Formats

    Regards,

    Ashwin

  • Posted 19 January 2021, 4:50 am EST

    Thank you for the advice Ashwin. It unfortunately does not fix the issue for me. The problem seems to be that the Agular2 modules currently only have ES5 code. For example, node_modules@grapecity\wijmo.angular2.grid_ivy_ngcc_\ only has es5-esm.js.

    For non-Angular implementations, your suggestion will likely work just fine.

    I am looking forward to seeing the ES2015 code added too. Thanks :slight_smile:

  • Posted 19 January 2021, 2:13 pm EST

    Hi,

    Thank you for the information. I have forwarded this info to the developers.

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels