Use vite to bundle source files, so that we can cache them.
Whats in the PR:
no functionality changes
only new dependency is vite
import our old dependencies using npm:
we can split our js code now into multiple files -> better readability
css is bundled into a single file. small images (< 4kB) are inlined into the css file (we import all icons in 'icons.js')
the geojson files are imported in 'base_radlkarte_object.js' and get a hash added to the filename when we build
I have added a vite plugin 'vite-plugin-replace-geojson-in-html.js' that replaces the references to the geojson files in the html file
cache headers are set as follows (using 2 .htacces files):
-- html is not cached
-- '.json' files in '/data/osm-overpass' are cached for one day
-- all other files get a 'version-hash' and are cached for one year
'yarn build' builds the project, 'yarn preview' builds and serves the project, 'yarn serve' serves the project directly from the source (without building)
fixed all lint errors (except one in 'loadGeoJson' -> that one needs a little refactoring, I would do that in another PR)
fixed some spelling and typing errors in index.html
I have added a github action to build and deploy the project
Use vite to bundle source files, so that we can cache them.
Whats in the PR:
I have added a github action to build and deploy the project
TODO: Update the Delopment.md to reflect the changes