Import local Javascript module

I think you answered your own question with that given one works and one does not. :wink:

I don’t think import/export are supported by Drafts in that Drafts would need to support JavaScript Modules like modern browsers, Node.js, etc. do.

It certainly is possible to manage your code externally to Drafts. I put most of my code in to separate files and use VS Code (or Code on iPad) to manage the code in the same sort of way you set out.

This thread might be of interest on that front too if you are just getting started with your setup.

2 Likes