SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.23k forks source link

How to use install npm packages in UI5? #2534

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi all

I followed the quick start from https://sap.github.io/ui5-tooling/ to create an UI5 application.

Then I've installed the npm package https://www.npmjs.com/package/moment with the command:

npm i moment The question is, how to include the moment library into the controller?

Hint: I am using Visual Studio Code as IDE

Thanks

RandomByte commented 5 years ago

You need to configure the moment dependency as a UI5 project using a "Project Shim" as documented here: https://github.com/SAP/ui5-project/blob/master/docs/Configuration.md#example-a

Another example can be found in this project: https://github.com/Michadelic/openui5-parallax/blob/master/ui5.yaml#L8