Skip to content

Commit

Permalink
local-server, rust-embed: exclude source map on release builds (TODO:…
Browse files Browse the repository at this point in the history
… is there a better way?)
  • Loading branch information
ilyagr committed Sep 29, 2024
1 parent ef2b5fb commit 16b9b70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ indexmap = { version = "2.5.0", features = ["serde"] }
open = "5.3.0"
parking_lot = "0.12.2"
poem = { version = "3.1.0", features = ["embed"] }
rust-embed = { version = "8.5.0" }
rust-embed = { version = "8.5.0" , features = ["include-exclude"] }
serde = { version = "1.0.210", features = ["serde_derive"] }
thiserror = "1.0.64"
tokio = { version = "1.38.0", features = [
Expand Down
7 changes: 7 additions & 0 deletions src/local_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ use crate::DataInterface;
type DataInterfacePointer = Arc<Mutex<Box<dyn DataInterface>>>;
pub type PortsToTry = Box<dyn Iterator<Item = usize>>;

#[cfg(debug_assertions)]
#[derive(rust_embed::Embed)]
#[folder = "webapp/dist/"]
struct StaticFiles;

#[cfg(not(debug_assertions))]
#[derive(rust_embed::Embed)]
#[folder = "webapp/dist/"]
#[exclude = "*.map"]
struct StaticFiles;

pub type ExitCode = i32;
#[derive(Debug, Error)]
pub enum MergeToolError {
Expand Down

0 comments on commit 16b9b70

Please sign in to comment.