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.
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.