Has anyone tried to make SKY UX work with 'tedious' module?
I am working on building a Constituent Dashboard Add-in pulling additional data from our SQL Server data warehouse based on the context (recordId). I've built some JS functions I can run in node, then "translated" them to ts to include them in the add-in project. The function is using 'tedious' module, a pure JavaScript implementation of the TDS protocol used to interact with SQL Server. However whenever I try to import 'tedious' module to my add-in spa, skyux build can't resolve several modules, dns, tls, fs, net among them. Searching through stackoverflow I found this:
https://stackoverflow.com/questions/51541561/module-not-found-cant-resolve-dns-in-pg-lib/64051156 In short, tedious is using promises that can only be used on the server-side, so webpack is trying to bundle things for the client that can only be used in the server. However, although the implementation depends on them, it does not require them to work. So it looks like there are workarounds for angular that can solve the problem, one involves specifying externals in webpack.config.js, the other one faking existence of the modules. Neither of them seems to work with
skyux builder.
I would also love to hear any other ideas how to pull and incorporate external SQL Server data in SKY Add-ins without building web services and/or my own API. Thank you