0x766f6c74 Posted September 6, 2022 Posted September 6, 2022 In this tutorial, I will show you how to use Svelte with RAGEMP for CEF. You will first normally create your Svelte project, and when you're done, save and run npm run build. You will then receive a new folder in your project called dist. Opening the dist folder, you will find index.html, a folder named assets, and maybe some other files depending on your project. If you try to run your project now by opening index.html, you will find a blank page. That's because Svelte bundles your project with relative paths, which will not work with how RAGEMP CEF's system work. To fix this, you simply change the paths to absolute paths manually. Here is my index#html, before changing anything. You can see the relative paths. (I removed the icon, if you have one) And after changing the relative paths to absolute paths, I'm left with this. It's a minimal change, and may be hard to notice, but the source for the script file is missing a slash in the start, same for the CSS. You can now open the index#html, and see that it's working.Some last words If you have a custom font you want to use, which is located in your project, you will have to open the CSS file and change the paths there as well. This tutorial covered Svelte, and not SvelteKit. I'm using "#" instead of a "." because otherwise I can't post due the websites security rules. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now