What’s are best Sage practices if my javascript functions are quite large / complicated? I have a 600 line main.js file at the moment and I’d REALLY love to split it up over separate files…
I’ve tried going into /lib/setup.php and doing:
wp_enqueue_script('sage/js', Assets\asset_path('scripts/tracker-setup.js'), ['jquery']);
This doesn’t work though, even though I’m putting the files into my manifest.json like:
"tracker-setup.js": {
"files": [
"scripts/tracker-setup.js"
]
}
Any ideas on what I’m doing wrong here? I can’t see this mentioned in the docs. I see a link to refer to the asset-builder docs but they’re pretty nonexistant and don’t really specify how to just simply add an additional javascript file…