I need to load a JS script located on a distant server I own. I'm working on differents projets which all require the same set of functions, that's why I'm using a script which allows me to manage all theses functions at the same time then load them when I need to.
But when I try to load my script from one of my projet I've some CORS policy errors. Do you have an idea of what would be the cleanest way to do this ?
Edit :
I load the script like this :
<script src="https://myServer/script.js" type="module"></script>
I would like to load my function like this :
import {test} from 'app.js';
test();
While app.js on my server is :
export function test() {
console.log('test');
}
Thx Maxime