How to include direct .js reference in Ionic application


I really want to try out the library iscroll in my Capacitor hosted Ionic application, we I want the momentum scrolling when built for desktop.

At this stage, I just want to see how it performs, but as explained here, I just cannot get it to even be included in an Ionic/Angular project.

So I thought I’d try and just manually include it. So I added it my folder eg D:\dev\capacitor\electron2\src\lib\iscroll.js, and added

<script src='build/iscroll.js'></script>

into D:\dev\capacitor\electron2\src\index.html, and finally added this to the tsconfig.json file…

"include": [
    "src/lib/*.js"  <--- added this

However this file is neither copied into the build folder, nor is it included in the bundle. If I look in D:\dev\capacitor\electron2\www\build\main.js none of the code is in there.

Does anyone have any idea to

  1. Either do this manual including
  2. Even better, include it via the node module as per the Stack overflow question

Thanks in advance!