I have created a simple Vue3 + Vite website to present something to another person. It works fine when previewing on my side (using npm run dev
or npm run build
+ npm run preview
and then opening the browser at localhost:5173
). It also works when deployed to Github Pages.
What I would like to do is to simply be able to hand over the HTML, CSS and JS files of the website to the other person and for them to be able to simply open the index.html
in the browser and view the website.
Currently, when trying that with index.html
(from the generated dist
directory) it does not work due to the:
Access to script at 'file:///assets/index-a911f458.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, isolated-app, brave, https, chrome-untrusted, data, chrome-extension, chrome.
error.
I want to avoid forcing the other person to install node.js as well as dockerizing the project etc.