How to import other JavaScript macro to a current working macro?

Hello everyone.

I have started working on JavaScript macro development.

Given I have two JavaScript macros like this.

  • library.js
  • myproject.js

image description

myproject.js is my current working macro and I what to import some reusable function in side library.js to this macro.

How do I import library.js to myproject.js?

Could you please give some suggestion, blog post or code example for this?

Thank you so much.

Hi, maybe you can create a new document in the project folder, modify it and delete the content, and then copy / paste the contents of the libray.js file.

If my answer helped you, vote it with :heavy_check_mark: (here on the left)

Hi thank you for suggestion. Please correct me if I understand it incorrectly.

Does it mean we will copy content of library.js to myproject.js?
If so, this is not what I want. I want to make library.js to reusable for other projects as well.
For example, inside my project.js, do we have something like.

import ‘library.js’
include ‘library.js’