Per the Build with ES modules guide, I'm using the @ArcGIS/core NPM package along with TypeScript and Webpack. A significant portion of the build-time for my app is spent compiling the ArcGIS JS SDK dependency. This is particularly noticeable when producing production builds on a build server. I want to reduce the build-time impact to as close to zero as possible.
What I'd ultimately like, is a pre-compiled version of the library. I do this with many other large 3rd party libraries, typically taking a local copy of the library and making use of Webpacks externals configuration. Without a pre-compiled ESM JS library (other than the "for testing only" / not optimised CDN version), I don't see a way to do this.
An alternative I explored was using Webpacks DllPlugin, thinking that if I still must compile it myself, I could at least compile it far less frequently. My apps own code is changed and re-compiled many times per day, but I don't change ArcGIS JS SDK version anywhere near that often. Why be forever re-building the same thing again and again? But ArcGIS JS SDK doesn't seem immediately friendly to DllPlugin, per my own quick experimentation, and this other question in the forum.
AMD modules would give me a pre-compiled option, but I'd like to keep TypeScript type-checking, and I see that's now deprecated for AMD. https://github.com/Esri/jsapi-resources/tree/main/typescript
"The AMD TypeScript declaration files and the arcgis-js-api npm package have been deprecated at 4.29 and will be retired at 4.31. if you are building a new application, we recommend using the @ArcGIS/core ES modules"
The only remaining option I can think if is a bit "outside of the box", and that's to create another entry point in my Webpack build dedicated to ArcGIS JS dependencies, and be selective about when I build that. That could be a bit clumsy though.
Am I missing anything? Does anyone have any insight into the future of ArcGIS JS SDK on this point? I see there's web components in (unsupported) beta for example, it looks like that might offer a pre-compiled option.