I am working on a typescript project with the 4.17 library. The template was downloaded from the github link below. I am having a hard time figuring out how to import a node library (I am trying to import pdf-merger-js after installing it with the npm install command). I know I can use a CDN link or have the js file referenced in my index.js but this library doesn't offer neither, and I really would like to learn how to use Node packages in this kind of project. Any help would be greatly appreciated. Thanks
https://github.com/Esri/jsapi-resources/tree/master/4.x/typescript
Thank you! I decided to use Webpack
If you want to use node packages, you'll need to use some sort of build tooling. That demo just compiles the TS to JS, but does no bundling of any sort. Tools like rollup and webpack can do that for you.
https://github.com/Esri/jsapi-resources/tree/master/esm-samples
https://github.com/Esri/jsapi-resources/tree/master/4.x/webpack/demo
If you are just getting started, the cli might be useful to try.
https://github.com/Esri/arcgis-js-cli
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.