Which is the best practice to include external js in custom node?

Which is the best practice to include external js in custom node?

I would like to use WebWorker and I need to point to an external javascript file.

Is it possible? How?

Thanks in advance.

Probably the geofence node is the best example so far - see https://github.com/hardillb/node-red-node-geofence/blob/52c67e9d038dbb1e0dc4247abefbdb5cd9af76a9/geofence.html#L192

Thanks a lot.
I still can't figure how to refer the static js.

If I create a subfolder "static" with my "webworker.js" I receive a 404.

So I have:

mynode/static/webworker.js

I tried:

var worker = new Worker("mynode/js/webworker.js");

var worker = new Worker("js/webworker.js");

var worker = new Worker("webworker.js");

I always receive a 404 not found error.

How to refer it?

Hi @gbove731

the bit that was missing from Dave's reply was that you also need to add some code in your node's js side to tell the runtime to serve those files.