UNPKG

1.7 kBMarkdownView Raw
1[npm]: https://img.shields.io/npm/v/@wesley-clements/rollup-plugin-raw-wasm
2[npm-url]: https://www.npmjs.com/package/@wesley-clements/rollup-plugin-raw-wasm
3[size]: https://packagephobia.now.sh/badge?p=@wesley-clements/rollup-plugin-raw-wasm
4[size-url]: https://packagephobia.now.sh/result?p=@wesley-clements/rollup-plugin-raw-wasm
5
6[![npm][npm]][npm-url]
7[![size][size]][size-url]
8[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)
9
10# @wesley-clements/rollup-plugin-raw-wasm
11
12A Rollup which allows loading `wasm` raw paths. This is just [the official Rollup wasm plugin](https://github.com/rollup/plugins/tree/master/packages/wasm) but does not instaniate a WebAssembly module.
13
14## Requirements
15
16This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
17
18## Install
19
20Using npm:
21
22```console
23npm install @wesley-clements/rollup-plugin-raw-wasm --save-dev
24```
25
26## Usage
27
28Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:
29
30```js
31import { rawWasm } from '@wesley-clements/rollup-plugin-raw-wasm';
32
33export default {
34 ...
35 plugins: [rawWasm()],
36 ...
37};
38```
39
40Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).
41
42## Options
43
44### `copy`
45
46Type: `Boolean`<br>
47Default: `true`
48
49Determines whether the wasm files will be copied to the output folder.
50
51### `publicPath`
52
53Type: `String`<br>
54Default: `''`
55
56A string which will be added in front of filenames when they are copied.
57
58[LICENSE (MIT)](/LICENSE)