You can write you're own server, set up a file system, copy files to it and have the server, serve them to your browser.
... or you can use a library (like mine) that can do all that logistics for you. Mine does it with three lines of code in you Sketch... then drag and drop your JS files (and other browser mark-up) onto the server created.
w/ GUI Admin Client, Drag & Drop File Manager, OTA Built-In, Access Point Manager,
Performance Metrics, Web Socket Comms, App API, All running on ESP8266...
Even usable on ESP-01S --- Please check it out!
https://inqonthat.com/inqportal-the-three-line-promise/
https://InqOnThat.com/inqportal