How do I include JS Javascript src links in SPA pages

I have one SPA page where I have a canvas for users to draw and manipulate graphics. This is only required on one page but it does require quite a few links to locally stored javascript files.

So naturally I thought I could simply add this to the SPA page

<script src="fabric/dist/canvas-toBlob.js"></script>

It doesn’t load.

And yet if I do the same thing with CSS

<link rel="stylesheet" href="css/prism.css">

This does load.

How can I have links to Javascript files on the SPA?

I could add them to the parent page, but then they would load each and every time. Or is that the way it should be?

This canvas area will not be used very often, but it is an important area.

Community Page
Last updated: