From cb383e5ca8f62ed6291331473fc8df73f8243062 Mon Sep 17 00:00:00 2001
From: Anthony Dodd <2380740+thedodd@users.noreply.github.com>
Date: Fri, 6 Aug 2021 10:53:39 -0500
Subject: [PATCH] Only use wasm-opt when in release mode (#217)
This addresses a few pain points where there was no way to reasonably
disable wasm-opt use for debug builds while keeping it enabled for
release builds. There seems to be very few (if any) use cases for using
wasm-opt on a debug build, as such, wasm-opt is now only run on release
builds when enabled.
closes #197
closes #175
---
CHANGELOG.md | 1 +
examples/vanilla/index.html | 2 +-
examples/yew/index.html | 2 +-
site/content/assets.md | 4 ++--
src/pipelines/rust_app.rs | 5 +++++
5 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 092e3c89..34f3232d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe
- Fixed [#209](https://github.com/thedodd/trunk/issues/209) where the default Rust App pipeline was causing wasm-opt to be used even for debug builds when the Rust App HTML link was being omitted.
- Closed [#168](https://github.com/thedodd/trunk/issues/158): RSS feed for blog.
- Isolated code used for version checking & formatting of version output for downloadable applications (wasm-bindgen & wasm-opt). Added unit tests to cover this logic.
+- Fixed [#197](https://github.com/thedodd/trunk/issues/197) & [#175](https://github.com/thedodd/trunk/pull/175) where disabling wasm-opt for debug builds while keeping it enable for release builds was not possible without some hacking. Now, wasm-opt will only be used for release builds and only when enabled. This semantically matches cargo's behavior with optimizations in release mode.
## 0.12.1
### fixed
diff --git a/examples/vanilla/index.html b/examples/vanilla/index.html
index 65001600..e33f712f 100644
--- a/examples/vanilla/index.html
+++ b/examples/vanilla/index.html
@@ -10,6 +10,6 @@