Skip to content

Commit

Permalink
Speed up backend build
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Feb 17, 2024
1 parent 9feb5a5 commit bd308fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
cd web
npm ci
npm run wasm
npm run wasm-release
npm run build --if-present
- name: Publish
Expand Down
5 changes: 5 additions & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ serde_json = "1.0.105"
serde-wasm-bindgen = "0.6.0"
wasm-bindgen = "0.2.87"
web-sys = { version = "0.3.64", features = ["console"] }

# For local development, build dependencies in release mode once, but otherwise
# use dev profile and avoid wasm-opt.
[profile.dev.package."*"]
opt-level = 3
3 changes: 2 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"wasm": "wasm-pack build --release --target web ../backend",
"wasm": "wasm-pack build --dev --target web ../backend",
"wasm-release": "wasm-pack build --release --target web ../backend",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"fmt": "npx prettier --write *.html src/**"
Expand Down
2 changes: 1 addition & 1 deletion web/src/title/MapLoader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
async function loadExample(example: string) {
if (example != "") {
if (useLocalVite) {
await loadFromUrl(`/${example}.pbf`);
await loadFromUrl(`/osm/${example}.pbf`);
} else {
await loadFromUrl(
`https://assets.od2net.org/severance_pbfs/${example}.pbf`,
Expand Down

0 comments on commit bd308fb

Please sign in to comment.