I have an HTML file named showMap.html:
showMap.html
Serve the map.js file as a static resource:
map.js
move the file to a static/ subdirectory of your package
static/
generate a static URL for it in a Jinja2 template like so:
The filename parameter takes a relative path; you can use subdirectories was needed.
filename