Hi,
so I've started working on a litte extension project for Node-RED.
So far I made good progress and came to a point where I have some common shared data in a separate file which my node code can require().
The package layout looks something like this (simplified):
|- my-node.html
|- my-node.js
|- lib
| \- shared-stuff.js
\- package.json
Is there any way to require or include 'shared-stuff.js' from the a script-block inside 'my-node.html' ?
What I like to do is use part of the shared data in the 'oneditprepare' callback to populate a 'select' with possible choices.
(And in that case I really don't want to duplicate the data in both html & js!)
So far I tried tried something like this in my callback:
var shared = require('lib/sharde-stuff');
event with different versions of specifying the path and with and without '.js' extension
all gave the same result: an error message from require that it can't load / locate the file.
In a desperate attempt I event tried using a separate <script type="text/javascript" src="..."> which in hindsight couldn't work..
Any help on this would be great..
Regards,
René