npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-rsw

v2.0.11

Published

wasm-pack plugin for Vite

Readme

vite-plugin-rsw

wasm-pack plugin for Vite

npm npm downloads vite version chat

awesome-rsw Rust WebAssembly

|rsw version|vite version| |---|---| | >= 2.0.0| >= 2.8.0| | >= 1.8.0| >= 2.4.0| |1.7.0|2.0.0 ~ 2.3.8|

Features

  • HMR
  • Friendly error message - browser and terminal

Pre-installed

  • rust
  • nodejs
  • wasm-pack
  • rsw-rs: rsw = rs(rust) → w(wasm) - A command-line tool for automatically rebuilding local changes, based on the wasm-pack implementation.

Usage

Step 1

Install rsw

cargo install rsw

Install vite-plugin-rsw

# With NPM:
npm i -D vite-plugin-rsw

# With Yarn:
yarn add -D vite-plugin-rsw

Step 2

Edit vite.config.ts

import { defineConfig } from 'vite';
import { ViteRsw } from 'vite-plugin-rsw';

export default defineConfig({
  plugins: [
    ViteRsw(),
  ],
})

Step 3

Edit package.json

"scripts": {
+   "dev": "rsw watch & vite",
+   "build": "rsw build && tsc && vite build",
+   "rsw": "rsw"
}

Step 4

rsw.toml options

  1. Initial rsw.toml

    # yarn rsw -h
    yarn rsw init
  2. Generate rust crate

    # rsw.toml
    [new]
    # using: wasm-pack | rsw | user, default is `wasm-pack`
    using = "wasm-pack"
    yarn rsw new rsw-hello
  3. Edit rsw.toml

    # link type: npm | yarn | pnpm, default is `npm`
    cli = "npm"
    
    [[crates]]
    name = "rsw-hello"
    # <npm|yarn|pnpm> link
    # ⚠️ Note: must be set to `true`, default is `false`
    link = true

Step 5

Start dev server

# rsw watch & vite
yarn dev

Step 6

Deploy

yarn build

Example

  • WA+ - 🤩 Making a web page more like a desktop application is just the beginning, the possibilities are unlimited, up to your imagination!
  • Demo - 🎲 Learning WebAssembly
  • Oh My Box - 🔮 Development toolbox, and more...

Related

create-mpl - ⚡️ Create a project in seconds!

# Quickly initialize a wasm project

# npm 6.x
npm init mpl@latest my-app --type wasm

# npm 7+, extra double-dash is needed:
npm init mpl@latest my-app -- --type wasm

微信

群二维码已过期,关注公众号《浮之静》,发送“进群”,我将拉你进群一起学习。

License

MIT License © 2021 lencx