Skip to content

Commit f43e7a2

Browse files
committed
Review wasml build
1 parent 4e6b9b6 commit f43e7a2

5 files changed

Lines changed: 715 additions & 492 deletions

File tree

underpass-wasm/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ yarn build
1616

1717
Folow data setup from [../src/duckdb_quackosm/README.md], but do not run the server.
1818

19-
## Run
19+
## Dev
2020

2121
Run the demo
2222
```
@@ -25,6 +25,20 @@ yarn dev
2525

2626
Then go to http://localhost:5173/
2727

28+
Note, the embedded HTTP server with dev does not support the HTTP range requests to partially download Parquet files. It falls back to full download of Parquet files, obviously, that is not the expected behavior.
29+
30+
## Build
31+
32+
```
33+
yarn build
34+
```
35+
36+
Then serve the static content with an HTTP web server supporting [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests) to partially download Parquet files.
37+
38+
```
39+
yarn serve
40+
```
41+
2842
## Reuse the lib
2943

3044
```bash

underpass-wasm/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h2>Demo</h2>
1919
<form>
2020
<label for="parquet">QuackOSM Parquet file URL</label></br>
2121
<input type="text" id="parquet" name="parquet" size="60"
22-
value="http://localhost:5173/data/extract_nofilter_noclip_compact.parquet" /><br>
22+
value="http://localhost:5173/data/landes-latest_nofilter_noclip_compact.parquet" /><br>
2323

2424
<label for="overpass-query">Overpass Query</label></br>
2525
<textarea id="overpass-query" rows="10" cols="60" placeholder="Enter your Overpass query here">

underpass-wasm/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
"pkg"
1818
],
1919
"scripts": {
20-
"build:wasm": "wasm-pack build --target web --out-dir ./pkg",
21-
"build:lib": "vite build",
22-
"build": "yarn build:wasm && yarn build:lib",
2320
"dev": "vite",
2421
"preview": "vite preview",
22+
"build:wasm": "wasm-pack build --target web --out-dir ./pkg",
23+
"build:lib": "vite build",
24+
"build": "yarn build:wasm && yarn build:lib && ln -s ../data dist/data",
25+
"serve": "serve --symlinks --cors dist",
2526
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
2627
},
2728
"devDependencies": {
@@ -30,6 +31,7 @@
3031
"@typescript-eslint/parser": "^8.35.1",
3132
"eslint": "^9.30.1",
3233
"typescript": "^5.8.3",
34+
"serve": "14.2.5",
3335
"vite": "^7.0.0",
3436
"vite-plugin-dts": "^4.5.4"
3537
},

underpass-wasm/vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export default defineConfig({
1616
formats: ['es', 'umd'],
1717
fileName: (format) => `underpass.${format}.js`
1818
},
19+
reportCompressedSize: false,
1920
rollupOptions: {
21+
input: {
22+
main: 'index.html'
23+
},
2024
external: [],
2125
output: {
2226
globals: {}

0 commit comments

Comments
 (0)