panoptix-za / web-bundler

Bundles a Rust WebAssembly frontend application for publishing
Apache License 2.0
11 stars 3 forks source link

Support overriding optimization settings for the frontend build #4

Open JWorthe opened 3 years ago

JWorthe commented 3 years ago

When using a workspace, Cargo only lets you set optimization settings at a workspace level. However, it's usually more important for web assets to be small, and so settings like LTO and optimization might be different between the main workspace and the frontend.

These settings can be overridden by setting Cargo's environment variables before running wasm-pack.

A good reference for sensible defaults is the Seed Quickstart.