Download local static file

I have an issue with downloading static local files in my electron app.

After building and bundling my web app (using webpack), I’m left with an index.html file and a static folder containing files which my web app is using, but on the electron app I can’t access them since their absolute path is not set as it should be. This is how I try to download the file on the renderer process:

<a href="/static/file1.csv">File1></a>

and on the main process when I catch the ‘will-download’ event I’m getting a relative path:

win.get().webContents.session.on('will-download', (event, item, webContents) => {`item: ${item.getURL()}`); // macOS: file:///static/file1.csv, windows: file:///c:/static/file1.csv

The file isn’t getting downloaded.
I’ve read a post suggesting to use protocol.interceptFileProtocol and change the file path, but when I use this option I can’t load the index.html file at all, apparently due to chrome security policy and the chrome output is:

Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with “unsafe-eval” enabled. This exposes users of this app to unnecessary security risks.

For more information and help, consult
This warning will not show up once the app is packaged.

Not allowed to load local resource: file:///MyFolder/index.html

What is the correct way to access static files from the renderer process, corresponding to electron’s security policy (