1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-04-02 10:21:07 +00:00

Merge pull request from alexcrichton/smaller

Shrink binary size of distributed `wasm-bindgen`
This commit is contained in:
Sendil Kumar N 2018-10-18 08:40:12 +02:00 committed by GitHub
commit dd80cf1ab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 1 deletions
.travis.yml
crates/cli/src/bin
wasm-bindgen-test-runner
wasm-bindgen.rswasm2es6js.rs

@ -151,7 +151,12 @@ matrix:
- rust: nightly - rust: nightly
env: JOB=dist-linux TARGET=x86_64-unknown-linux-musl env: JOB=dist-linux TARGET=x86_64-unknown-linux-musl
before_script: rustup target add $TARGET before_script: rustup target add $TARGET
script: cargo build --manifest-path crates/cli/Cargo.toml --release --target $TARGET --features vendored-openssl script:
- cargo build --manifest-path crates/cli/Cargo.toml --release --target $TARGET --features vendored-openssl
# no need to ship debuginfo to users
- strip -g target/$TARGET/release/wasm-bindgen
- strip -g target/$TARGET/release/wasm-bindgen-test-runner
- strip -g target/$TARGET/release/wasm2es6js
addons: addons:
apt: apt:
packages: packages:

@ -36,6 +36,10 @@ use failure::{Error, ResultExt};
use parity_wasm::elements::{Deserialize, Module, Section}; use parity_wasm::elements::{Deserialize, Module, Section};
use wasm_bindgen_cli_support::Bindgen; use wasm_bindgen_cli_support::Bindgen;
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
mod headless; mod headless;
mod node; mod node;
mod server; mod server;

@ -13,6 +13,10 @@ use docopt::Docopt;
use failure::Error; use failure::Error;
use wasm_bindgen_cli_support::Bindgen; use wasm_bindgen_cli_support::Bindgen;
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
const USAGE: &'static str = " const USAGE: &'static str = "
Generating JS bindings for a wasm file Generating JS bindings for a wasm file

@ -11,6 +11,10 @@ use std::process;
use docopt::Docopt; use docopt::Docopt;
use failure::{Error, ResultExt}; use failure::{Error, ResultExt};
// no need for jemalloc bloat in this binary (and we don't need speed)
#[global_allocator]
static ALLOC: std::alloc::System = std::alloc::System;
const USAGE: &'static str = " const USAGE: &'static str = "
Converts a wasm file to an ES6 JS module Converts a wasm file to an ES6 JS module