Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"build": "tsc -b && jlpm run cp:gdal",
"build:gallery": "python rasterlayer_gallery_generator.py",
"cp:gdal": "cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.data lib && cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.wasm lib",
"cp:gdal": "cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.data lib && cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.wasm lib && cp ../../node_modules/gdal3.js/dist/package/gdal3.js lib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Can we use brace expansion to shorten?

Suggested change
"cp:gdal": "cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.data lib && cp ../../node_modules/gdal3.js/dist/package/gdal3WebAssembly.wasm lib && cp ../../node_modules/gdal3.js/dist/package/gdal3.js lib",
"cp:gdal": "cp ../../node_modules/gdal3.js/dist/package/{gdal3WebAssembly.data,gdal3WebAssembly.wasm,gdal3.js} lib",

"build:prod": "jlpm run clean && jlpm run build",
"build:dev": "tsc -b && jlpm run cp:gdal",
"clean": "rimraf tsconfig.tsbuildinfo",
Expand Down
7 changes: 4 additions & 3 deletions packages/base/src/gdal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import initGdalJs from 'gdal3.js';
export async function getGdal() {
const dataurl = new URL('./gdal3WebAssembly.data', import.meta.url);
const wasmurl = new URL('./gdal3WebAssembly.wasm', import.meta.url);
const jsurl = new URL('./gdal3.js', import.meta.url);

// TODO Pass gdal JS too and run gdal in a worker?
return await initGdalJs({
paths: {
wasm: wasmurl.href,
data: dataurl.href
data: dataurl.href,
js: jsurl.href
},
useWorker: false
useWorker: true
});
}

Expand Down
Loading