Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-wasm-pack

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-wasm-pack

wasm-pack for Vite

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-12.33%
Maintainers
1
Weekly downloads
 
Created
Source

🚚 vite-plugin-wasm-pack

npm

Vite plugin for wasm-pack rust

Install

yarn add vite vite-plugin-wasm-pack -D
# or
# npm i vite vite-plugin-wasm-pack vite -D

Usage

Add this plugin to vite.config.ts

import { defineConfig } from 'vite';
import wasmPack from 'vite-plugin-wasm-pack';

export default defineConfig({
  build: {
    minify: false
  },
  // pass your crate path to the plugin
  plugins: [wasmPack('./my-crate')]
});

Don't forget to build your wasm-pack crate first!

wasm-pack build ./my-crate --target web

Add command to package.json

"scripts": {
  "dev": "vite",
  "build": "vite build"
}

Start dev server, and install my-crate that you build earlier.

yarn dev

Complete example

please check ./example folder.

License

MIT, see the license file

Keywords

FAQs

Package last updated on 23 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc