Skip to content

Commit

Permalink
chore: added tree shaking and bundling optimizations (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlwn123 authored Sep 18, 2024
1 parent 012e4a1 commit b8e0875
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
14 changes: 8 additions & 6 deletions packages/core-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
},
"files": [
"dist",
"src",
"wasm"
"src"
],
"sideEffects": [
"./dist/worker.js",
"./dist/index.js"
],
"sideEffects": false,
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"dependencies": {
"fedimint-client-wasm": "file:./wasm"
"@fedimint/fedimint-client-wasm": "file:./wasm"
},
"bundledDependencies": [
"fedimint-client-wasm"
"bundleDependencies": [
"@fedimint/fedimint-client-wasm"
],
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
Expand Down
6 changes: 2 additions & 4 deletions packages/core-web/src/worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// import { WasmClient } from '../wasm/fedimint_client_wasm.js'
// import { WasmClient } from 'fedimint-client-wasm'
// import wasm from '../wasm/fedimint_client_wasm_bg.wasm'
// Web Worker for fedimint-client-wasm to run in the browser

let WasmClient = null
let client = null
Expand All @@ -15,7 +13,7 @@ self.onmessage = async (event) => {
const { type, payload, requestId } = event.data

if (type === 'init') {
WasmClient = (await import('fedimint-client-wasm')).WasmClient
WasmClient = (await import('@fedimint/fedimint-client-wasm')).WasmClient
self.postMessage({ type: 'initialized', data: {}, requestId })
} else if (type === 'open') {
const { clientName } = payload
Expand Down
9 changes: 3 additions & 6 deletions packages/core-web/wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "fedimint-client-wasm",
"name": "@fedimint/fedimint-client-wasm",
"private": true,
"type": "module",
"collaborators": [
"The Fedimint Developers"
],
"description": "fedimint client for wasm",
"version": "0.5.0-alpha",
"description": "Wasm-pack output for fedimint-client-wasm",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

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

0 comments on commit b8e0875

Please sign in to comment.