Building a TypeScript website using the ArcGIS Javascript API

751
1
Jump to solution
11-18-2020 01:42 PM
LanceCole
MVP Regular Contributor

I am starting a new GIS website that will be using the ArcGIS Javascript API.  We will be using TypeScript for the majority of the site development.  The project will also contain several custom widgets as well as customized default widgets.  

So far I have been able to get the test site to build using tsc installed with Typescript.  This results in many generated JavaScript files for the main site and related custom widgets  The second approach has been using webpack to build the app.  This is great except I do not really want to bundle the entire ArcGIS Javascript API and related CSS to host on our system. 

Is there something in between, without adding in a framework such as React or Angular?  My pea sized brain is already on overload.  I am looking for something to package our custom js/ts code and css/scss to be used in conjunction with the ArcGIS JavaScript API CDN

The two approaches we used are loosely based upon @ReneRubalcava's demos posted on github noted below:

https://github.com/Esri/jsapi-resources/tree/master/4.x/webpack/demo

https://github.com/Esri/jsapi-resources/tree/master/4.x/typescript/demo

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

You can check out this template app, it uses rollup to bundle your code and uses the CDN.

https://github.com/Esri/arcgis-js-cli/tree/master/templates/basic-cdn/app

 

View solution in original post

0 Kudos
1 Reply
ReneRubalcava
Frequent Contributor

You can check out this template app, it uses rollup to bundle your code and uses the CDN.

https://github.com/Esri/arcgis-js-cli/tree/master/templates/basic-cdn/app

 

0 Kudos