Trying to learn custom frappe app development, and I’ve run into the following issue:
I’ve written some javascript on a custom Frappe application that is located in myapp/public/js/my_utils.js. I also wrote a build.json in myapp/public to bundle the code for minificiation.
I’ve confirmed the minified js file has been written to sites/assets after running
bench update --build
And my js code is in the minified folder. However, my min.js is never being server to the site that has the custom app installed. I wrote a form hook along the lines of
or… may i add a third option?
3. create a build.json file in public folder and include it on your own filename.min.js or other name that you like and then add a hook as app_include_js, like this:
build.son file:
{
"css/jasper_erpnext_report.css": [
"public/css/callouts.css"
],
"js/jasper_erpnext_report.js": [
"public/js/jasper_erpnext_report.js"
]
}
hooks.py file:
app_include_js = ["/assets/jasper_erpnext_report/js/jasper_erpnext_report.js"] if you like to refresh and don't want make frappe --build every time you change the file.
or app_include_js = ["/assets/js/jasper_erpnext_report.js"] if you want to do frappe --build every time!