parcel-rust-wasm
v2.13.3
Published
**parcel-rust-wasm** is a WebAssembly-powered drop-in replacement for [`@parcel/rust`](https://github.com/parcel-bundler/parcel/tree/v2/packages/core/rust). It’s tailored for browser environments and allows you to leverage Rust’s performance and safety by
Downloads
5
Readme
parcel-rust-wasm
parcel-rust-wasm is a WebAssembly-powered drop-in replacement for @parcel/rust. It’s tailored for browser environments and allows you to leverage Rust’s performance and safety by compiling your Rust code to WebAssembly, all while using Parcel as your bundler.
Installation
How to Set Up the Alias
Update your package.json dependencies as follows:
// package.json
{
"dependencies": {
"parcel": "^2.13.3",
"@parcel/rust": "npm:parcel-rust-wasm@^2.13.3"
}
}With this configuration, any module that imports @parcel/rust will use parcel-rust-wasm instead, ensuring a seamless transition.
Configuration & Customization
For most projects, no additional configuration is necessary. However, if you need to customize how Parcel processes WebAssembly assets or adjust build settings, refer to the Parcel documentation.
Development
Building from Source
Clone the Repository:
git clone https://github.com/yourusername/parcel-rust-wasm.git cd parcel-rust-wasmInstall Dependencies:
npm installBuild the Project:
npm run build
Running Tests
To run the test suite, execute:
npm testContributing
Contributions are welcome! To contribute:
- Fork the Repository.
- Create a New Branch for your feature or bug fix.
- Ensure Your Code Meets Our Standards.
- Submit a Pull Request with detailed information about your changes.
For more details, please see our CONTRIBUTING.md.
License
parcel-rust-wasm is licensed under the MIT License. See the LICENSE file for more information.
FAQ
Why Use parcel-rust-wasm?
parcel-rust-wasm allows you to run Rust code in the browser through WebAssembly, combining the performance and safety of Rust with the simplicity of Parcel’s build system. The embedded alias in package.json makes the transition from @parcel/rust effortless.
How Does the Alias Work?
By adding the following configuration in your package.json, any import of @parcel/rust is automatically resolved to parcel-rust-wasm:
"dependencies": {
"@parcel/rust": "npm:parcel-rust-wasm@^1.6.1"
}This approach leverages npm’s aliasing feature to provide a seamless replacement without requiring changes in your code.
Support
If you encounter any issues or have questions, please open an issue on our GitHub repository or join our community discussions.
Happy coding!
