Neos Eel Helper to embed inline JavaScript from files.
composer require netlogix/eel-javascript
You can use the JavaScriptHelper in your Fusion files like this:
To include scripts that don't require external variables, you can use the embed
method.
script = ${Netlogix.JavaScript.embed('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js')}
To include scripts that require external variables, you can use the embedWithVariables
method.
scriptWithVars = ${Netlogix.JavaScript.embedWithVariables('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js', {'someVariableName': 'someValue'})}
This will prefix the included javascript file with the variables passed to the method:
var someVariable= 'someValue';
/// ... your script ScriptWithVars.js