Skip to content

Commit

Permalink
Got wasm working.
Browse files Browse the repository at this point in the history
nshen/vite-plugin-wasm-pack#20 was the cause
of prior confusion.
  • Loading branch information
dabreegster committed Dec 21, 2022
1 parent bbfa57a commit 2763772
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 6 deletions.
143 changes: 139 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
"prettier": "^2.8.1",
"prettier-plugin-svelte": "^2.9.0",
"svelte": "^3.54.0",
"vite": "^4.0.0"
"vite": "^4.0.3",
"vite-plugin-wasm-pack": "0.1.11"
},
"dependencies": {
"material-icons": "^1.13.1",
"osm2streets-js": "^0.1.1",
"svelte-material-ui": "^7.0.0-beta.0"
}
}
6 changes: 6 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
import TabBar from "@smui/tab-bar";
import Button from "@smui/button";
import init, { JsStreetNetwork } from "osm2streets-js";
let panel1 = false;
let panel2 = false;
let activeTab = "Residential";
init().then(() => {
console.log(`It worked!?`);
});
</script>

<h1>Playground</h1>
Expand Down
3 changes: 2 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import wasmPack from 'vite-plugin-wasm-pack';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
plugins: [svelte(), wasmPack([], ['osm2streets-js'])],
base: "/svelte_playground/"
})

0 comments on commit 2763772

Please sign in to comment.