Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include wasm blobs in size calculation? #299

Closed
fryorcraken opened this issue Sep 27, 2022 · 3 comments
Closed

How to include wasm blobs in size calculation? #299

fryorcraken opened this issue Sep 27, 2022 · 3 comments

Comments

@fryorcraken
Copy link

My project https://github.com/waku-org/js-rln uses wasm blobs that are dynamically imported.

When running size-limit with the following config:

module.exports = [
  {
    name: "RLN Instance",
    path: "bundle/index.js",
    import: "{ create }",
  },
];

The wasm blobs are not included:

✔ Adding to empty webpack project
✔ Running JS in headless Chrome
  
  Size:         1.35 kB with all dependencies, minified and gzipped
  Loading time: 27 ms   on slow 3G
  Running time: 51 ms   on Snapdragon 410
  Total time:   78 ms
▶ ls -lh bundle/assets
total 5.1M
-rw-r--r--. 1 fryorcraken fryorcraken 1.2M Sep 27 14:22 rln-fb4d7b4b.wasm
-rw-r--r--. 1 fryorcraken fryorcraken 3.1M Sep 27 14:22 rln_final-a641c06e.zkey
-rw-r--r--. 1 fryorcraken fryorcraken 839K Sep 27 14:22 rln_wasm_bg-0185b546.wasm
@ai
Copy link
Owner

ai commented Sep 27, 2022

Can you show bundle/ content?

@fryorcraken
Copy link
Author

Can you show bundle/ content?

waku-org/js-rln/bundle  feat/verify-no-root ✔                                                                                                                                                                                                                     29d11h  ⍉
▶ tree 
.
├── 02bce7e5f3bcf834.wasm
├── 20ff36861f56116ae72f.module.wasm
├── 939.index.js
├── assets
│   ├── rln-fb4d7b4b.wasm
│   ├── rln_final-a641c06e.zkey
│   ├── rln_wasm_bg-0185b546.wasm
│   ├── rln_wasm_bg-72ac39a3.wasm
│   └── rln_wasm_bg-a7027f94.wasm
├── index.js
├── rln-0e12a076.js
├── rln-4592cf99.js
├── rln-78416578.js
├── rln-79a18618.js
├── rln-a1a9aa71.js
├── rln-ae2fde2f.js
└── rln-affbe9d4.js

1 directory, 16 files

@ai
Copy link
Owner

ai commented Nov 9, 2022

Something like this will work

module.exports = [
  {
    name: "RLN Instance",
    path: "bundle/index.js",
    import: "{ create }",
  },
  {
    name: "RLN WASM addons",
    path: "bundle/assets/*.wasm"
  },
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants