Personally I'de like to split large scripts into multiple files to maintain overview, or split classes from the main script.
When setting the 'enableWeb' to true, a directory should be created using the same name as the script. The web files are then placed within the 'html' folder located in the folder that was created for the plugin, making the folder structure like this (where [name] is the name of the script):
scripts/[name]
scripts/[name]/html
I would propose to create another folder within the [name] folder with a name something like 'modules', creating a folder structure like this:
scripts/[name]
scripts/[name]/html
scripts/[name]/modules
Requireing those 'modules' could be done like this:
Kind regards,
Cakemasher
When setting the 'enableWeb' to true, a directory should be created using the same name as the script. The web files are then placed within the 'html' folder located in the folder that was created for the plugin, making the folder structure like this (where [name] is the name of the script):
scripts/[name]
scripts/[name]/html
I would propose to create another folder within the [name] folder with a name something like 'modules', creating a folder structure like this:
scripts/[name]
scripts/[name]/html
scripts/[name]/modules
Requireing those 'modules' could be done like this:
JavaScript:
var my_module = require('script_name/modules/module_name.js')
// or
var my_module = require('modules/module_name.js');
// or
var my_module = require(__modules + '/module_name.js');
Kind regards,
Cakemasher