# You must change these to your own details.
[package]
name = "visualdl"
description = "VisualDL WASM"
version = "0.1.0"
publish = false
repository = "https://github.com/PaddlePaddle/VisualDL.git"
authors = ["PeterPanZH <littlepanzh@gmail.com>"]
categories = ["wasm"]
readme = "README.md"
license = "Apache 2.0"
edition = "2018"

[lib]
path = "src/main.rs"
crate-type = ["cdylib"]

[profile.release]
# This makes the compiled code faster and smaller, but it makes compiling slower,
# so it's only enabled in release mode.
lto = true
debug = true

[features]
# If you uncomment this line, it will enable `wee_alloc`:
# default = ["wee_alloc"]

[dependencies]
serde = "1.0.112"
serde_derive = "1.0.112"
rulinalg = "0.4.2"

# The `wasm-bindgen` crate provides the bare minimum functionality needed
# to interact with JavaScript.
[dependencies.wasm-bindgen]
version = "0.2.63"
features = ["serde-serialize"]

# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
# compared to the default allocator's ~10K. However, it is slower than the default
# allocator, so it's not enabled by default.
# wee_alloc = { version = "0.4.5", optional = true }

# The `web-sys` crate allows you to interact with the various browser APIs,
# like the DOM.
[dependencies.web-sys]
version = "0.3.40"
features = ["console"]

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled
# in debug mode.
[target."cfg(debug_assertions)".dependencies]
console_error_panic_hook = "0.1.6"

# These crates are used for running unit tests.
[dev-dependencies]
wasm-bindgen-test = "0.3.13"
futures = "0.3.5"
js-sys = "0.3.40"
wasm-bindgen-futures = "0.4.13"

[package.metadata.wasm-pack.profile.dev]
# Should `wasm-opt` be used to further optimize the wasm binary generated after
# the Rust compiler has finished? Using `wasm-opt` can often further decrease
# binary size or do clever tricks that haven't made their way into LLVM yet.
#
# Configuration is set to `false` by default for the dev profile, but it can
# be set to an array of strings which are explicit arguments to pass to
# `wasm-opt`. For example `['-Os']` would optimize for size while `['-O4']`
# would execute very expensive optimizations passes
wasm-opt = false

[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
# Should we enable wasm-bindgen's debug assertions in its generated JS glue?
debug-js-glue = true
# Should wasm-bindgen demangle the symbols in the "name" custom section?
demangle-name-section = true
# Should we emit the DWARF debug info custom sections?
dwarf-debug-info = false

# `wasm-opt` is on by default in for the release profile, but it can be
# disabled by setting it to `false`
[package.metadata.wasm-pack.profile.release]
wasm-opt = ['-O']

[package.metadata.wasm-pack.profile.release.wasm-bindgen]
debug-js-glue = false
demangle-name-section = true
dwarf-debug-info = false
