Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically create map definitions and store them separately in a JSON #29

Open
WUOTE opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@WUOTE
Copy link
Contributor

WUOTE commented Apr 24, 2024

src/map_definitions.json
[
  {
    key: "regular-main-branch",
    ...
  }, ...
]


src/build_tilesources.js
const fs = require('fs');
const defs = JSON.parse(fs.readFileSync('./map_definitions.json', 'utf-8'));
const tileSources = /* .. do stuff to defs .. */;
fs.writeFileSync('./tilesources.json', JSON.stringify(tileSources));


src/script.js
import tileSources from './tilesources.json';
...


build.sh
#!/bin/bash

set -e

(cd src && node build_tilesources.js)
cp src/tilesources.json dist/tilesources.json
npx webpack


upload.sh
#!/bin/bash

set -e

./build.sh
wrangler deploy ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant