Menci / Menci/vite-plugin-wasm

Plugin always bundles Wasm as base64 when vitest is installed

Open
#46 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
431
Forks
27
PR merge metrics
No merged PRs in 30d

Description

I have a Vite app, and I have Vitest installed. When I run vite build, my Wasm file is bundled as base64, even though I want it to be bundled as a URL. This line of code seems to be the problem:

https://github.com/Menci/vite-plugin-wasm/blob/f9718b9df29822010c81c0630f2cadce9fafc6fe/src/index.ts#L16

I guess the config plugins includes vitest even when I'm not using it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/index.ts#L16 and inspect how the plugin config identifies Vitest when running a Vite build. Reproduce the issue with a Vite app that has Vitest installed and run vite build; done means the Wasm asset is emitted as a URL rather than bundled as base64.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vite, wasm
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.