wasm-tool/rollup-plugin-rust

Custom wasm-pack build command

aminya opened this issue · 3 comments

I want to use the following wasm-pack for building my rust program:

"wasm": "wasm-pack build --target bundler",

or
--target nodejs

Is this possible using rollup-plugin-rust?

In the wasm-pack plugin, I can do this using extraArgs:

extraArgs: "--target bundler --mode normal",
Pauan commented

This plugin calls wasm-pack for you, so you cannot call wasm-pack yourself.

Instead, just use "wasm": "rollup --config" and create a rollup.config.js file which includes the plugin. It will handle everything for you.

@Pauan The default options don't suit my use case. See this comment: #6 (comment)

Pauan commented

Since the underlying issue with Node has been fixed, I'm going to close this.