Skip to content

Commit

Permalink
fix: harper.js is now imported properly on the website
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Dec 17, 2024
1 parent 69c0780 commit 7ec1673
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/harper.js/src/loadWasm.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import wasmUrl from 'wasm/harper_wasm_bg.wasm?url';

/** Load the WebAssembly manually and dynamically, making sure to setup infrastructure. */
export default async function loadWasm() {
const wasm = await import('wasm');
await wasm.default(wasmUrl);
await wasm.default();

return wasm;
}
16 changes: 14 additions & 2 deletions packages/harper.js/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ export default defineConfig({
fileName: `harper`,
name: 'harper',
formats: ['es']
},
rollupOptions: {
output: {
inlineDynamicImports: true
}
}
},
base: './',
plugins: [dts({ rollupTypes: true, tsconfigPath: './tsconfig.json' })],
worker: {
plugins: [],
format: 'es'
format: 'es',

rollupOptions: {
output: {
inlineDynamicImports: true
}
}
},
server: {
fs: {
Expand All @@ -28,5 +39,6 @@ export default defineConfig({
enabled: true,
name: 'chromium'
}
}
},
assetsInclude: ['**/*.wasm']
});
10 changes: 10 additions & 0 deletions packages/obsidian-plugin/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "harper",
"name": "Harper",
"version": "0.12.0",
"minAppVersion": "0.15.0",
"description": "The Grammar Checker for Developers",
"author": "Elijah Potter",
"authorUrl": "https://elijahpotter.dev",
"isDesktopOnly": true
}

0 comments on commit 7ec1673

Please sign in to comment.