All Projects → rollup → Rollup Plugin Wasm

rollup / Rollup Plugin Wasm

This module has moved and is now available at @rollup/plugin-wasm / https://github.com/rollup/plugins

Projects that are alternatives of or similar to Rollup Plugin Wasm

Proxy Wasm Cpp Sdk
WebAssembly for Proxies (C++ SDK)
Stars: ✭ 55 (-26.67%)
Mutual labels:  webassembly
Dockerdot
🐳 dockerdot shows dockerfile dependenciy graph. This is useful to understand how build dockerfile. This uses Go WebAssembly + BuildKit package.
Stars: ✭ 65 (-13.33%)
Mutual labels:  webassembly
Magnum Bootstrap
Bootstrap projects for Magnum C++11/C++14 graphics engine
Stars: ✭ 69 (-8%)
Mutual labels:  webassembly
Tail Call
Proposal to add tail calls to WebAssembly
Stars: ✭ 61 (-18.67%)
Mutual labels:  webassembly
Rust Webapp Template
Template project for Rust web app
Stars: ✭ 64 (-14.67%)
Mutual labels:  webassembly
Magnum Plugins
Plugins for the Magnum C++11/C++14 graphics engine
Stars: ✭ 66 (-12%)
Mutual labels:  webassembly
Rust By Example Ext
Rust by Example -- Extended Edition
Stars: ✭ 56 (-25.33%)
Mutual labels:  webassembly
Wagi
Write HTTP handlers in WebAssembly with a minimal amount of work
Stars: ✭ 75 (+0%)
Mutual labels:  webassembly
Wasmer Python
🐍🕸 WebAssembly runtime for Python
Stars: ✭ 1,131 (+1408%)
Mutual labels:  webassembly
Web Audio Javascript Webassembly Sdk Interactive Audio
🌐 Superpowered Web Audio JavaScript and WebAssembly SDK for modern web browsers. Allows developers to implement low-latency interactive audio features into web sites and web apps with a friendly Javascript API. https://superpowered.com
Stars: ✭ 68 (-9.33%)
Mutual labels:  webassembly
Blazor Wasm Identity Grpc
Blazor WASM, IdentityServer4, Kestrel Web Server, Entity Framework Code First SQLite Database with Multiple Roles, Additional User Claims & gRPC with Roles Authorization.
Stars: ✭ 61 (-18.67%)
Mutual labels:  webassembly
Disable Webassembly
Browser hacks to disable WebAssembly (WASM)
Stars: ✭ 63 (-16%)
Mutual labels:  webassembly
Create Near App
Create a starter app hooked up to the NEAR blockchain
Stars: ✭ 66 (-12%)
Mutual labels:  webassembly
Vxformgenerator
The library contains a component, that nests itself into the Blazor EditForm instead of a wrapper around the EditForm. The component is able to generate a form based on a POCO or a ExpandoObject. Because of this architecture the library provides the developer flexibility and direct usage of the EditForm.
Stars: ✭ 60 (-20%)
Mutual labels:  webassembly
Veracruz
Main repository for the Veracruz privacy-preserving compute project.
Stars: ✭ 71 (-5.33%)
Mutual labels:  webassembly
Tokamak
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
Stars: ✭ 1,083 (+1344%)
Mutual labels:  webassembly
Qt
Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
Stars: ✭ 8,966 (+11854.67%)
Mutual labels:  webassembly
Full Stack Fortran
Fortran to WebAssembly
Stars: ✭ 75 (+0%)
Mutual labels:  webassembly
Contract
Play EOS Game On
Stars: ✭ 73 (-2.67%)
Mutual labels:  webassembly
Muze
Composable data visualisation library for web with a data-first approach now powered by WebAssembly
Stars: ✭ 1,153 (+1437.33%)
Mutual labels:  webassembly

Moved

This module has moved and is now available at @rollup/plugin-wasm. Please update your dependencies. This repository is no longer maintained.

rollup-plugin-wasm

semantic-release

Rollup plugin for importing WebAssembly modules.

Use this Rollup plugin to import WebAssembly modules and bundle them as base64 strings. They are imported async (but small modules can be imported sync).

Install

npm i -D rollup-plugin-wasm

Configuration

Add the plugin to your rollup config and then any imported .wasm file will be processed by it.

import wasm from 'rollup-plugin-wasm'

export default {
  input: 'web/index.js',
  plugins: [
    wasm()
  ]
}

Example

Given the following simple C file (compiled using emscripten, or the online WasmFiddle tool):

int main() {
  return 42;
}

Import and instantiate the resulting file:

import wasm from './sample.wasm';

wasm({ ...imports }).then(({ instance }) => {
  console.log(instance.exports.main())
})

The WebAssembly is inlined as a base64 encoded string (which means it will be ~33% larger than the original). At runtime the string is decoded and a module is returned.

Sync Modules

Small modules (< 4KB) can be compiled synchronously by specifying them in the configuration.

wasm({
  sync: [
    'web/sample.wasm',
    'web/foobar.wasm'
  ]
})

This means that the exports can be accessed immediately.

import module from './sample.wasm'

const instance = sample({ ...imports })

console.log(instance.exports.main())
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].