evolus / pencil

The Pencil Project's unique mission is to build a free and opensource tool for making diagrams and GUI prototyping that everyone can use.
http://pencil.evolus.vn
GNU General Public License v2.0
9.04k stars 717 forks source link

Include JS file in Definition's Script #735

Open lppedd opened 2 years ago

lppedd commented 2 years ago

Developing a new Collection, given the following:

<Shapes>  
  <Script>
      <!-- Include JS file (e.g. from the same directory as this Definition.xml file) -->  
  </Script>
  ... 
</Shapes>  

Is this possible?

lppedd commented 2 years ago

So, this seems to be possible, by exposing the script as a Node module, and then using require You can use collection.relURL to know the base path of the collection.