TGRHavoc / live_map-interface

Web interface for the FiveM live_map addon
https://docs.tgrhavoc.co.uk/livemap-interface/
53 stars 30 forks source link

Feat: webpack #92

Closed TGRHavoc closed 2 years ago

TGRHavoc commented 2 years ago

Woop woop. A proper development flow is here!

So... I originally used Gulp because I knew how to use it and breaking stuff up into seperate tasks seemed logical (like building the CSS files from SCSS).

Now, I've dived into webpack a bit and it seems like a whole better system. For example, developers can create a local server to test their changes before it gets built into the production bundles.

It also allows us to create unique file names for each release, allowing us to cache bust and remove any cache issues.

Hopefully this makes everything much easier to read and follow. For example, before you would see window.MapL in a couple of files but now, it's clear that it's the Map inside map.js file (it also provides intellisense in VSCode).

I still have a lot of documentation to do and I now need to go back to the tests branch and re-write them for the new structure.

This PR also adds a new hash_handler file which will implement #45. Still a work in progress (a lot more handlers will be added) but for the time being we can change the following:

debug=true/false - to enable/disable debug mode (console.logs). server=name - to show a certain server.

Examples: livemap_url.com/#debug=true - Will enable debug mode (overrides whatever is in config.json). livemap_url.com/#debug=false&server=Reverse+proxy - Will disable debug mode and show "Reverse proxy" server from the example config.