import './normalize.js';
import { ModLoader } from './ccloader.js';

if (window.process) {
	const envVar = process.env.CCLOADER_OVERRIDE_MAIN_URL;
	if (envVar) {
		window.location.replace(envVar);
	}
}

window.onload = () => {
	const modloader = new ModLoader();
	modloader.startGame()
		.then()
		.catch(err => console.error('Something went wrong while loading the game', err));
};

@@ -187,22 +187,55 @@
 replace(
-envVar
+new URL(envVar, window.location.origin)
 );%0D%0A%09%7D%0D%0A

Resolve CCLOADER_OVERRIDE_MAIN_URL relative to the game directory