Gathering detailed insights and metrics for vite-plugin-wasm-pack
Gathering detailed insights and metrics for vite-plugin-wasm-pack
Gathering detailed insights and metrics for vite-plugin-wasm-pack
Gathering detailed insights and metrics for vite-plugin-wasm-pack
vite-plugin-wasm
Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
vite-plugin-rsw
wasm-pack plugin for Vite
@jondot/vite-plugin-wasm-pack
Vite plugin for rust using wasm-pack 🦀
@pognetwork/vite-plugin-wasm-pack
Vite plugin for rust using wasm-pack 🦀
npm install vite-plugin-wasm-pack
Typescript
Module System
Node Version
NPM Version
85
Supply Chain
98.9
Quality
75.9
Maintenance
100
Vulnerability
100
License
TypeScript (80.39%)
Rust (9.92%)
HTML (9.69%)
Total Downloads
632,531
Last Day
657
Last Week
8,162
Last Month
33,319
Last Year
519,706
MIT License
254 Stars
56 Commits
39 Forks
3 Watchers
1 Branches
6 Contributors
Updated on May 06, 2025
Minified
Minified + Gzipped
Latest Version
0.1.12
Package Id
vite-plugin-wasm-pack@0.1.12
Unpacked Size
14.11 kB
Size
4.75 kB
File Count
5
NPM Version
8.5.5
Node Version
16.15.0
Cumulative downloads
Total Downloads
Last Day
-61.4%
657
Compared to previous day
Last Week
-14.1%
8,162
Compared to previous week
Last Month
-10.7%
33,319
Compared to previous month
Last Year
792.7%
519,706
Compared to previous year
6
🦀 Vite plugin for rust wasm-pack, it's simple.
Make sure wasm-pack installed correctly.
Clone this repo or download the zip file, extract the example folder.
example
|
|-- my-crate # rust project folder, there is a Cargo.toml in it
|-- src # front end source code
| |-- index.ts # entry point
|-- index.html # html entry
|-- vite.config.ts # vite config file
|__ package.json # npm config file
Install npm develop dependencies, in example folder run:
1yarn install 2# or 3# npm install
After that you can build rust project
to WebAassembly
by using wasm-pack
.
1wasm-pack build ./my-crate --target web
Now the my-crate
module is ready, start vite dev server.
1yarn dev 2or 3#npm run dev
Done, if below is showing.
1 vite v2.6.5 dev server running at: 2 3 > Local: http://localhost:3000/ 4 5 ready in 169ms.
1yarn add vite vite-plugin-wasm-pack -D 2# or 3# npm i vite vite-plugin-wasm-pack vite -D
Add this plugin to vite.config.ts
1import { defineConfig } from 'vite';
2import wasmPack from 'vite-plugin-wasm-pack';
3
4export default defineConfig({
5 // pass your local crate path to the plugin
6 plugins: [wasmPack('./my-crate')]
7});
Add script to package.json
1"scripts": { 2 "dev": "vite", 3 "build": "vite build" 4}
⚠ Don't forget to build your wasm-pack crate first!
1wasm-pack build ./my-crate --target web
Tips: you can add a wasm
script to package.json
like this:
1"scripts": { 2 "wasm": "wasm-pack build ./my-crate --target web", 3 "dev": "yarn wasm && vite", 4 "build": "vite build" 5}
Then, run:
1yarn dev
This will start dev server, and install my-crate
that you built earlier.
If you want use a package from npm that built with wasm-pack, like this one test-npm-crate
you have to pass the package name to the second param of our plugin.
wasmPack(['./my-local-crate'],['test-npm-crate'])
full example is in ./npm-crate-example folder.
notice, we only support package build with --target web
for now , if a package you use is built without --target web
, you should rebuild it.
like this example [Photon-vite] [source]
I'm not sure if anybody have met the problem that after modified your package, your package don't update.
That's becasue vite pre bundling your package, you can follow vite guide to solve the problem.
If you met the problem , or any problems. feel free to create an issue, let me see if I can do something to help you, thanks.
MIT, see the license file
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/23 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
16 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More