@galacticcouncil/sdk 0.0.1-beta.6 → 0.0.1-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wasm-loader.ts +0 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacticcouncil/sdk",
3
- "version": "0.0.1-beta.6",
3
+ "version": "0.0.1-beta.7",
4
4
  "private": false,
5
5
  "description": "Galactic SDK",
6
6
  "author": "Pavol Noha <palo@hydradx.io>",
package/wasm-loader.ts DELETED
@@ -1,39 +0,0 @@
1
- import { Plugin } from 'esbuild';
2
- import path from 'path';
3
- import fs from 'fs';
4
-
5
- interface WasmLoaderOptions {
6
- name: string;
7
- }
8
-
9
- const wasmLoader = (options?: WasmLoaderOptions): Plugin => ({
10
- name: 'wasm-loader',
11
-
12
- setup(build) {
13
- build.onResolve({ filter: /\.wasm$/ }, (args) => {
14
- if (args.resolveDir === '') {
15
- return;
16
- }
17
-
18
- return {
19
- path: path.isAbsolute(args.path)
20
- ? args.path
21
- : path.join(args.resolveDir, args.path),
22
- namespace: 'wasm-binary',
23
- };
24
- });
25
-
26
- build.onLoad({ filter: /.*/, namespace: 'wasm-binary' }, async (args) => ({
27
- contents: await fs.promises.readFile(args.path),
28
- loader: 'binary',
29
- }));
30
-
31
- build.onLoad({ filter: /.*/, namespace: 'wasm-stub' }, async (args) => ({
32
- contents: `import wasm from ${JSON.stringify(args.path)}
33
- export default async (imports) =>
34
- (await WebAssembly.instantiate(wasm, imports)).instance.exports`,
35
- }));
36
- },
37
- });
38
-
39
- export default wasmLoader;