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 |
|
12 | A 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 |
|
16 | This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
|
17 |
|
18 | ## Install
|
19 |
|
20 | Using npm:
|
21 |
|
22 | ```console
|
23 | npm install @wesley-clements/rollup-plugin-raw-wasm --save-dev
|
24 | ```
|
25 |
|
26 | ## Usage
|
27 |
|
28 | Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:
|
29 |
|
30 | ```js
|
31 | import { rawWasm } from '@wesley-clements/rollup-plugin-raw-wasm';
|
32 |
|
33 | export default {
|
34 | ...
|
35 | plugins: [rawWasm()],
|
36 | ...
|
37 | };
|
38 | ```
|
39 |
|
40 | Then 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 |
|
46 | Type: `Boolean`<br>
|
47 | Default: `true`
|
48 |
|
49 | Determines whether the wasm files will be copied to the output folder.
|
50 |
|
51 | ### `publicPath`
|
52 |
|
53 | Type: `String`<br>
|
54 | Default: `''`
|
55 |
|
56 | A string which will be added in front of filenames when they are copied.
|
57 |
|
58 | [LICENSE (MIT)](/LICENSE)
|