前のページ
Featured image of post Webassembly に入門してみた。 Rust で実装。

Webassembly に入門してみた。 Rust で実装。

WebAssembly と聞いて「あーあれね」から脱するが目的

前回、「Webassembly に入門してみた。 」の続編です。

前回 C 言語で書いていたところを Rust で実装してみるというやってみた系の記事です。

今回ハマるところがあまりなかった(OpenSSLくらい)のでただの記録記事になっています。


Rust でやってみる。

Rust は以下を`参照しながらインストール。

https://developer.mozilla.org/en-US/docs/WebAssembly/rust_to_wasm

wasm-pack crate をインストールします。

❯ cargo install wasm-pack
  Updating crates.io index
  Downloaded wasm-pack v0.9.1
  Downloaded 1 crate (422.5 KB) in 6.04s
  Installing wasm-pack v0.9.1
  Downloaded log v0.4.8
  Downloaded reqwest v0.9.24
  Downloaded structopt v0.2.18
  Downloaded atty v0.2.14
  Downloaded which v2.0.1
  Downloaded binary-install v0.0.2
  Downloaded toml v0.4.10
  Downloaded dirs v1.0.5
  Downloaded dialoguer v0.3.0
  Downloaded failure v0.1.7
  Downloaded env_logger v0.5.13
  Downloaded glob v0.2.11
  Downloaded serde_json v1.0.51
  Downloaded human-panic v1.0.3
  Downloaded chrono v0.4.11
  Downloaded curl v0.4.28
  Downloaded semver v0.9.0
  Downloaded serde v1.0.106
  Downloaded serde_derive v1.0.106
  Downloaded parking_lot v0.6.4
  Downloaded siphasher v0.2.3
  Downloaded strsim v0.8.0
  Downloaded walkdir v2.3.1
  Downloaded console v0.6.2
  Downloaded serde_ignored v0.0.4
  Downloaded cargo_metadata v0.8.2
  Downloaded backtrace v0.3.46
  Downloaded zip v0.5.5
  Downloaded uuid v0.8.1
  Downloaded cfg-if v0.1.10
  Downloaded termcolor v1.1.0
  Downloaded syn v1.0.17
  Downloaded quote v1.0.3
  Downloaded parking_lot_core v0.3.1
  Downloaded socket2 v0.3.12
  Downloaded failure_derive v0.1.7
  Downloaded tokio-threadpool v0.1.18
  Downloaded tokio-timer v0.2.13
  Downloaded curl-sys v0.4.30+curl-7.69.1
  Downloaded http v0.1.21
  Downloaded num-traits v0.2.11
  Downloaded tempfile v2.2.0
  Downloaded time v0.1.42
  Downloaded console v0.10.0
  Downloaded hex v0.3.2
  Downloaded flate2 v1.0.14
  Downloaded openssl-probe v0.1.2
  Downloaded is_executable v0.1.2
  Downloaded libc v0.2.68
  Downloaded num-integer v0.1.42
  Downloaded toml v0.5.6
  Downloaded proc-macro2 v1.0.10
  Downloaded lock_api v0.1.5
  Downloaded base64 v0.10.1
  Downloaded bytes v0.4.12
  Downloaded cookie v0.12.0
  Downloaded os_type v2.2.0
  Downloaded encoding_rs v0.8.22
  Downloaded mime v0.3.16
  Downloaded uuid v0.7.4
  Downloaded tokio-executor v0.1.10
  Downloaded itoa v0.4.5
  Downloaded tokio-io v0.1.13
  Downloaded humantime v1.3.0
  Downloaded mime_guess v2.0.3
  Downloaded serde_urlencoded v0.5.5
  Downloaded openssl-sys v0.9.54
  Downloaded clap v2.33.0
  Downloaded url v1.7.2
  Downloaded hyper-tls v0.3.2
  Downloaded tokio v0.1.22
  Downloaded semver-parser v0.7.0
  Downloaded native-tls v0.2.4
  Downloaded ryu v1.0.3
  Downloaded hyper v0.12.35
  Downloaded futures v0.1.29
  Downloaded cookie_store v0.7.0
  Downloaded lazy_static v1.4.0
  Downloaded tar v0.4.26
  Downloaded unicode-xid v0.2.0
  Downloaded quick-error v1.2.3
  Downloaded unicode-width v0.1.7
  Downloaded podio v0.1.6
  Downloaded rand v0.3.23
  Downloaded autocfg v1.0.0
  Downloaded pkg-config v0.3.17
  Downloaded miniz_oxide v0.3.6
  Downloaded bzip2 v0.3.3
  Downloaded termios v0.3.2
  Downloaded clicolors-control v0.2.0
  Downloaded parking_lot v0.10.0
  Downloaded matches v0.1.8
  Downloaded smallvec v0.6.13
  Downloaded synstructure v0.12.3
  Downloaded crc32fast v1.2.0
  Downloaded rand v0.5.6
  Downloaded percent-encoding v1.0.1
  Downloaded libz-sys v1.0.25
  Downloaded fnv v1.0.6
  Downloaded net2 v0.2.33
  Downloaded http-body v0.1.0
  Downloaded tokio-reactor v0.1.12
  Downloaded iovec v0.1.4
  Downloaded bitflags v1.2.1
  Downloaded structopt-derive v0.2.18
  Downloaded num_cpus v1.12.0
  Downloaded scopeguard v0.3.3
  Downloaded owning_ref v0.4.1
  Downloaded idna v0.1.5
  Downloaded either v1.5.3
  Downloaded rustc_version v0.2.3
  Downloaded clicolors-control v1.0.1
  Downloaded rand v0.6.5
  Downloaded crossbeam-deque v0.7.3
  Downloaded same-file v1.0.6
  Downloaded ansi_term v0.11.0
  Downloaded crossbeam-utils v0.7.2
  Downloaded tokio-current-thread v0.1.7
  Downloaded mio v0.6.21
  Downloaded rand v0.7.3
  Downloaded httparse v1.3.4
  Downloaded tokio-buf v0.1.1
  Downloaded vec_map v0.8.1
  Downloaded dtoa v0.4.5
  Downloaded tokio-tcp v0.1.4
  Downloaded cc v1.0.50
  Downloaded slab v0.4.2
  Downloaded futures-cpupool v0.1.8
  Downloaded byteorder v1.3.4
  Downloaded openssl v0.10.28
  Downloaded h2 v0.1.26
  Downloaded backtrace-sys v0.1.35
  Downloaded regex v1.3.6
  Downloaded rustc-demangle v0.1.16
  Downloaded textwrap v0.11.0
  Downloaded unicase v2.6.0
  Downloaded crossbeam-queue v0.2.1
  Downloaded want v0.2.0
  Downloaded adler32 v1.0.4
  Downloaded unicode-normalization v0.1.12
  Downloaded rand_core v0.3.1
  Downloaded rand_isaac v0.1.1
  Downloaded unicode-bidi v0.3.4
  Downloaded stable_deref_trait v1.1.1
  Downloaded thread_local v1.0.1
  Downloaded rand_chacha v0.2.2
  Downloaded rand_jitter v0.1.4
  Downloaded parking_lot_core v0.7.0
  Downloaded try_from v0.3.2
  Downloaded quote v0.6.13
  Downloaded getrandom v0.1.14
  Downloaded parking_lot v0.9.0
  Downloaded xattr v0.2.2
  Downloaded indexmap v1.3.2
  Downloaded filetime v0.2.9
  Downloaded aho-corasick v0.7.10
  Downloaded lock_api v0.3.3
  Downloaded string v0.2.1
  Downloaded memchr v2.3.3
  Downloaded regex-syntax v0.6.17
  Downloaded rand_os v0.1.3
  Downloaded rand_core v0.4.2
  Downloaded crossbeam-epoch v0.8.2
  Downloaded heck v0.3.1
  Downloaded rand_chacha v0.1.1
  Downloaded rand v0.4.6
  Downloaded tokio-sync v0.1.8
  Downloaded rand_core v0.5.1
  Downloaded syn v0.15.44
  Downloaded maybe-uninit v2.0.0
  Downloaded autocfg v0.1.7
  Downloaded proc-macro2 v0.4.30
  Downloaded rand_xorshift v0.1.1
  Downloaded rand_pcg v0.1.2
  Downloaded rand_hc v0.1.0
  Downloaded foreign-types v0.3.2
  Downloaded publicsuffix v1.5.4
  Downloaded lazy_static v0.2.11
  Downloaded scopeguard v1.1.0
  Downloaded memoffset v0.5.4
  Downloaded parking_lot_core v0.6.2
  Downloaded ppv-lite86 v0.2.6
  Downloaded smallvec v1.2.0
  Downloaded unicode-segmentation v1.6.0
  Downloaded unicode-xid v0.1.0
  Downloaded version_check v0.9.1
  Downloaded try-lock v0.2.2
  Downloaded bzip2-sys v0.1.8+1.0.8
  Downloaded error-chain v0.12.2
  Downloaded idna v0.2.0
  Downloaded foreign-types-shared v0.1.1
  Downloaded url v2.1.1
  Downloaded percent-encoding v2.1.0
   Compiling libc v0.2.68
   Compiling cfg-if v0.1.10
   Compiling autocfg v1.0.0
   Compiling proc-macro2 v1.0.10
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.17
   Compiling cc v1.0.50
   Compiling serde v1.0.106
   Compiling lazy_static v1.4.0
   Compiling semver-parser v0.7.0
   Compiling pkg-config v0.3.17
   Compiling futures v0.1.29
   Compiling maybe-uninit v2.0.0
   Compiling log v0.4.8
   Compiling byteorder v1.3.4
   Compiling rand_core v0.4.2
   Compiling scopeguard v1.1.0
   Compiling either v1.5.3
   Compiling smallvec v1.2.0
   Compiling version_check v0.9.1
   Compiling memchr v2.3.3
   Compiling autocfg v0.1.7
   Compiling slab v0.4.2
   Compiling fnv v1.0.6
   Compiling matches v0.1.8
   Compiling itoa v0.4.5
   Compiling regex-syntax v0.6.17
   Compiling bitflags v1.2.1
   Compiling rustc-demangle v0.1.16
   Compiling failure_derive v0.1.7
   Compiling getrandom v0.1.14
   Compiling crc32fast v1.2.0
   Compiling ryu v1.0.3
   Compiling unicode-width v0.1.7
   Compiling proc-macro2 v0.4.30
   Compiling openssl v0.10.28
   Compiling openssl-probe v0.1.2
   Compiling percent-encoding v1.0.1
   Compiling httparse v1.3.4
   Compiling foreign-types-shared v0.1.1
   Compiling unicode-xid v0.1.0
   Compiling adler32 v1.0.4
   Compiling try-lock v0.2.2
   Compiling native-tls v0.2.4
   Compiling syn v0.15.44
   Compiling percent-encoding v2.1.0
   Compiling ppv-lite86 v0.2.6
   Compiling stable_deref_trait v1.1.1
   Compiling encoding_rs v0.8.22
   Compiling unicode-segmentation v1.6.0
   Compiling curl v0.4.28
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.1
   Compiling scopeguard v0.3.3
   Compiling strsim v0.8.0
   Compiling termcolor v1.1.0
   Compiling mime v0.3.16
   Compiling quick-error v1.2.3
   Compiling podio v0.1.6
   Compiling lazy_static v0.2.11
   Compiling dtoa v0.4.5
   Compiling is_executable v0.1.2
   Compiling siphasher v0.2.3
   Compiling hex v0.3.2
   Compiling same-file v1.0.6
   Compiling glob v0.2.11
   Compiling try_from v0.3.2
   Compiling thread_local v1.0.1
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling lock_api v0.3.3
   Compiling unicode-normalization v0.1.12
   Compiling unicode-bidi v0.3.4
   Compiling tokio-sync v0.1.8
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.4
   Compiling crossbeam-epoch v0.8.2
   Compiling indexmap v1.3.2
   Compiling num-traits v0.2.11
   Compiling num-integer v0.1.42
   Compiling textwrap v0.11.0
   Compiling foreign-types v0.3.2
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling miniz_oxide v0.3.6
   Compiling owning_ref v0.4.1
   Compiling unicase v2.6.0
   Compiling error-chain v0.12.2
   Compiling humantime v1.3.0
   Compiling heck v0.3.1
   Compiling walkdir v2.3.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling idna v0.1.5
   Compiling idna v0.2.0
   Compiling lock_api v0.1.5
   Compiling want v0.2.0
   Compiling smallvec v0.6.13
   Compiling aho-corasick v0.7.10
   Compiling quote v1.0.3
   Compiling base64 v0.10.1
   Compiling iovec v0.1.4
   Compiling time v0.1.42
   Compiling num_cpus v1.12.0
   Compiling net2 v0.2.33
   Compiling atty v0.2.14
   Compiling rand v0.4.6
   Compiling flate2 v1.0.14
   Compiling termios v0.3.2
   Compiling rand_os v0.1.3
   Compiling socket2 v0.3.12
   Compiling parking_lot_core v0.7.0
   Compiling xattr v0.2.2
   Compiling rand v0.5.6
   Compiling filetime v0.2.9
   Compiling clicolors-control v1.0.1
   Compiling dirs v1.0.5
   Compiling clicolors-control v0.2.0
   Compiling openssl-sys v0.9.54
   Compiling backtrace-sys v0.1.35
   Compiling libz-sys v1.0.25
   Compiling curl-sys v0.4.30+curl-7.69.1
   Compiling bzip2-sys v0.1.8+1.0.8
   Compiling quote v0.6.13
   Compiling url v1.7.2
   Compiling url v2.1.1
   Compiling tokio-executor v0.1.10
   Compiling crossbeam-queue v0.2.1
   Compiling regex v1.3.6
   Compiling bytes v0.4.12
   Compiling futures-cpupool v0.1.8
   Compiling mio v0.6.21
   Compiling clap v2.33.0
   Compiling env_logger v0.5.13
   Compiling rand_core v0.5.1
   Compiling parking_lot v0.10.0
   Compiling rand v0.3.23
   Compiling tar v0.4.26
   Compiling mime_guess v2.0.3
   Compiling tokio-timer v0.2.13
   Compiling tokio-current-thread v0.1.7
   Compiling cookie v0.12.0
   Compiling crossbeam-deque v0.7.3
   Compiling tokio-io v0.1.13
   Compiling http v0.1.21
   Compiling tokio-buf v0.1.1
   Compiling string v0.2.1
   Compiling chrono v0.4.11
error: failed to run custom build command for `openssl-sys v0.9.54`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installMlCxmt/release/build/openssl-sys-b8df789818791623/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit code: 1\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = x86_64-unknown-linux-gnu
openssl-sys = 0.9.54

', /home/XXXXXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.54/build/find_normal.rs:150:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: build failed, waiting for other jobs to finish...
error: failed to compile `wasm-pack v0.9.1`, intermediate artifacts can be found at `/tmp/cargo-installMlCxmt`

Caused by:
  build failed
cargo install wasm-pack  284.78s user 7.35s system 492% cpu 59.364 total

上の方でOpenSSLのエラーがでて失敗するので、OpenSSLのパッケージをインストール。

sudo apt-get install libssl-dev

もう一度実行。

❯ cargo install wasm-pack        
    Updating crates.io index
  Installing wasm-pack v0.9.1
   Compiling libc v0.2.68
   Compiling cfg-if v0.1.10
   Compiling autocfg v1.0.0
   Compiling proc-macro2 v1.0.10
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.17
   Compiling cc v1.0.50
   Compiling serde v1.0.106
   Compiling lazy_static v1.4.0
   Compiling semver-parser v0.7.0
   Compiling pkg-config v0.3.17
   Compiling futures v0.1.29
   Compiling maybe-uninit v2.0.0
   Compiling byteorder v1.3.4
   Compiling log v0.4.8
   Compiling rand_core v0.4.2
   Compiling scopeguard v1.1.0
   Compiling smallvec v1.2.0
   Compiling either v1.5.3
   Compiling memchr v2.3.3
   Compiling version_check v0.9.1
   Compiling autocfg v0.1.7
   Compiling slab v0.4.2
   Compiling matches v0.1.8
   Compiling fnv v1.0.6
   Compiling itoa v0.4.5
   Compiling regex-syntax v0.6.17
   Compiling bitflags v1.2.1
   Compiling failure_derive v0.1.7
   Compiling getrandom v0.1.14
   Compiling rustc-demangle v0.1.16
   Compiling unicode-width v0.1.7
   Compiling ryu v1.0.3
   Compiling proc-macro2 v0.4.30
   Compiling crc32fast v1.2.0
   Compiling openssl v0.10.28
   Compiling foreign-types-shared v0.1.1
   Compiling adler32 v1.0.4
   Compiling unicode-xid v0.1.0
   Compiling httparse v1.3.4
   Compiling openssl-probe v0.1.2
   Compiling percent-encoding v1.0.1
   Compiling percent-encoding v2.1.0
   Compiling native-tls v0.2.4
   Compiling ppv-lite86 v0.2.6
   Compiling try-lock v0.2.2
   Compiling syn v0.15.44
   Compiling stable_deref_trait v1.1.1
   Compiling unicode-segmentation v1.6.0
   Compiling curl v0.4.28
   Compiling encoding_rs v0.8.22
   Compiling vec_map v0.8.1
   Compiling ansi_term v0.11.0
   Compiling podio v0.1.6
   Compiling strsim v0.8.0
   Compiling scopeguard v0.3.3
   Compiling dtoa v0.4.5
   Compiling termcolor v1.1.0
   Compiling lazy_static v0.2.11
   Compiling mime v0.3.16
   Compiling quick-error v1.2.3
   Compiling same-file v1.0.6
   Compiling siphasher v0.2.3
   Compiling hex v0.3.2
   Compiling is_executable v0.1.2
   Compiling glob v0.2.11
   Compiling try_from v0.3.2
   Compiling thread_local v1.0.1
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling lock_api v0.3.3
   Compiling unicode-normalization v0.1.12
   Compiling unicode-bidi v0.3.4
   Compiling textwrap v0.11.0
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.4
   Compiling crossbeam-epoch v0.8.2
   Compiling indexmap v1.3.2
   Compiling num-traits v0.2.11
   Compiling num-integer v0.1.42
   Compiling foreign-types v0.3.2
   Compiling miniz_oxide v0.3.6
   Compiling tokio-sync v0.1.8
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling owning_ref v0.4.1
   Compiling unicase v2.6.0
   Compiling error-chain v0.12.2
   Compiling heck v0.3.1
   Compiling humantime v1.3.0
   Compiling walkdir v2.3.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling lock_api v0.1.5
   Compiling idna v0.1.5
   Compiling idna v0.2.0
   Compiling want v0.2.0
   Compiling smallvec v0.6.13
   Compiling aho-corasick v0.7.10
   Compiling base64 v0.10.1
   Compiling quote v1.0.3
   Compiling iovec v0.1.4
   Compiling time v0.1.42
   Compiling num_cpus v1.12.0
   Compiling net2 v0.2.33
   Compiling atty v0.2.14
   Compiling rand v0.4.6
   Compiling termios v0.3.2
   Compiling rand_os v0.1.3
   Compiling flate2 v1.0.14
   Compiling filetime v0.2.9
   Compiling parking_lot_core v0.7.0
   Compiling rand v0.5.6
   Compiling socket2 v0.3.12
   Compiling clicolors-control v1.0.1
   Compiling xattr v0.2.2
   Compiling dirs v1.0.5
   Compiling clicolors-control v0.2.0
   Compiling quote v0.6.13
   Compiling openssl-sys v0.9.54
   Compiling backtrace-sys v0.1.35
   Compiling libz-sys v1.0.25
   Compiling bzip2-sys v0.1.8+1.0.8
   Compiling curl-sys v0.4.30+curl-7.69.1
   Compiling url v1.7.2
   Compiling url v2.1.1
   Compiling tokio-executor v0.1.10
   Compiling crossbeam-queue v0.2.1
   Compiling regex v1.3.6
   Compiling bytes v0.4.12
   Compiling futures-cpupool v0.1.8
   Compiling mime_guess v2.0.3
   Compiling mio v0.6.21
   Compiling clap v2.33.0
   Compiling env_logger v0.5.13
   Compiling rand_core v0.5.1
   Compiling parking_lot v0.10.0
   Compiling rand v0.3.23
   Compiling tar v0.4.26
   Compiling cookie v0.12.0
   Compiling tokio-current-thread v0.1.7
   Compiling tokio-timer v0.2.13
   Compiling crossbeam-deque v0.7.3
   Compiling tokio-io v0.1.13
   Compiling http v0.1.21
   Compiling string v0.2.1
   Compiling tokio-buf v0.1.1
   Compiling publicsuffix v1.5.4
   Compiling console v0.10.0
   Compiling os_type v2.2.0
   Compiling chrono v0.4.11
   Compiling rand_chacha v0.2.2
   Compiling console v0.6.2
   Compiling synstructure v0.12.3
   Compiling tempfile v2.2.0
   Compiling uuid v0.7.4
   Compiling tokio-threadpool v0.1.18
   Compiling http-body v0.1.0
   Compiling h2 v0.1.26
   Compiling rand v0.7.3
   Compiling dialoguer v0.3.0
   Compiling backtrace v0.3.46
   Compiling bzip2 v0.3.3
   Compiling uuid v0.8.1
   Compiling zip v0.5.5
   Compiling structopt-derive v0.2.18
   Compiling serde_derive v1.0.106
   Compiling structopt v0.2.18
   Compiling failure v0.1.7
   Compiling which v2.0.1
   Compiling binary-install v0.0.2
   Compiling semver v0.9.0
   Compiling serde_json v1.0.51
   Compiling serde_urlencoded v0.5.5
   Compiling toml v0.5.6
   Compiling serde_ignored v0.0.4
   Compiling toml v0.4.10
   Compiling rustc_version v0.2.3
   Compiling parking_lot_core v0.6.2
   Compiling parking_lot v0.9.0
   Compiling hyper v0.12.35
   Compiling parking_lot_core v0.3.1
   Compiling human-panic v1.0.3
   Compiling cookie_store v0.7.0
   Compiling cargo_metadata v0.8.2
   Compiling parking_lot v0.6.4
   Compiling tokio-reactor v0.1.12
   Compiling tokio-tcp v0.1.4
   Compiling tokio v0.1.22
   Compiling hyper-tls v0.3.2
   Compiling reqwest v0.9.24
   Compiling wasm-pack v0.9.1
    Finished release [optimized] target(s) in 59.72s
  Installing /home/XXXXXXX/.cargo/bin/wasm-pack
   Installed package `wasm-pack v0.9.1` (executable `wasm-pack`)
cargo install wasm-pack  532.94s user 11.56s system 910% cpu 59.796 total

npm ユーザの作成

私は npm のユーザを持っていなかったのでユーザ作成します。

❯ mkdir webassembly-rust
❯ cd webassembly-rust 
❯ ls
❯ npm adduser  
Username: XXXXXX
Password: 
Email: (this IS public) XXXXXX@gmail.com
Logged in as XXXXXX on https://registry.npmjs.org/.


   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │      New minor version of npm available! 6.10.2 → 6.14.4       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.14.4   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

Rust プロジェクト作成

cargo で rust プロジェクト作成します。

cargo new --lib hello-wasm
     Created library `hello-wasm` package

wasm-pack 実行

ソースをドキュメント通りに書いて、

❯ wasm-pack build --scope XXXXXXX
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling hello-wasm v0.1.0 (/home/XXXXXXX/data/src/webassembly-rust/hello-wasm)
    Finished release [optimized] target(s) in 0.33s
:-) [WARN]: origin crate has no README
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 32.94s
[INFO]: :-) Your wasm pkg is ready to publish at /home/XXXXXXX/data/src/webassembly-rust/hello-wasm/pkg.

npm としてパブリッシュする。

エラーでた npm ユーザ作成した後にVerifyが必要なので実施後、再度実施。

403 Forbidden - PUT https://registry.npmjs.org/@%2fhello-wasm - you must verify your email before publishing a new package: https://www.npmjs.com/email-edit

npmでVerifyしてから再度実行。

npm publish --access=public
npm notice 
npm notice 📦  @XXXXXXX/hello-wasm@0.1.0
npm notice === Tarball Contents === 
npm notice 2.4kB  hello_wasm.js     
npm notice 299B   package.json      
npm notice 116B   hello_wasm.d.ts   
npm notice 13.6kB hello_wasm_bg.wasm
npm notice === Tarball Details === 
npm notice name:          @XXXXXXX/hello-wasm                     
npm notice version:       0.1.0                                   
npm notice package size:  7.2 kB                                  
npm notice unpacked size: 16.4 kB                                 
npm notice shasum:        567abe7b1129b2fdd38a28ab6501c64d2e23bd81
npm notice integrity:     sha512-RWOwz+6mvKKV5[...]EdTEwbwKbKMhg==
npm notice total files:   4                                       
npm notice 
+ @XXXXXXX/hello-wasm@0.1.0

ウェブ上でパッケージを作成する。

cd ../..
❯ ls
hello-wasm/
❯ mkdir site            
❯ cd site 

ソースをドキュメント通り書いて実行。

❯ npm install                  
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN site No description
npm WARN site No repository field.
npm WARN site No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules/fsevents/node_modules/abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/abbrev' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.abbrev.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules/fsevents/node_modules/ansi-regex):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/ansi-regex' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.ansi-regex.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules/fsevents/node_modules/aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/aproba' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.aproba.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules/fsevents/node_modules/balanced-match):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/balanced-match' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.balanced-match.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.4 (node_modules/fsevents/node_modules/chownr):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/chownr' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.chownr.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules/fsevents/node_modules/code-point-at):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/code-point-at' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.code-point-at.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules/fsevents/node_modules/concat-map):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/concat-map' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.concat-map.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules/fsevents/node_modules/console-control-strings):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/console-control-strings' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.console-control-strings.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules/fsevents/node_modules/core-util-is):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/core-util-is' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.core-util-is.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules/fsevents/node_modules/deep-extend):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/deep-extend' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.deep-extend.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules/fsevents/node_modules/delegates):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/delegates' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.delegates.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules/fsevents/node_modules/detect-libc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/detect-libc' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.detect-libc.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules/fsevents/node_modules/fs.realpath):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/fs.realpath' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.fs.realpath.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules/fsevents/node_modules/has-unicode):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/has-unicode' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.has-unicode.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules/fsevents/node_modules/inherits):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/inherits' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.inherits.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules/fsevents/node_modules/ini):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/ini' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.ini.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules/fsevents/node_modules/isarray):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/isarray' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.isarray.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.5 (node_modules/fsevents/node_modules/minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/minimist' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.minimist.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules/fsevents/node_modules/ms):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/ms' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.ms.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules/fsevents/node_modules/npm-normalize-package-bin):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/npm-normalize-package-bin' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.npm-normalize-package-bin.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules/fsevents/node_modules/number-is-nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/number-is-nan' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.number-is-nan.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules/fsevents/node_modules/object-assign):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/object-assign' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.object-assign.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules/fsevents/node_modules/os-homedir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/os-homedir' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.os-homedir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules/fsevents/node_modules/os-tmpdir):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/os-tmpdir' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.os-tmpdir.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules/fsevents/node_modules/path-is-absolute):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/path-is-absolute' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.path-is-absolute.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules/fsevents/node_modules/process-nextick-args):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/process-nextick-args' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.process-nextick-args.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules/fsevents/node_modules/safe-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/safe-buffer' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.safe-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules/fsevents/node_modules/safer-buffer):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/safer-buffer' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.safer-buffer.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules/fsevents/node_modules/sax):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/sax' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.sax.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules/fsevents/node_modules/semver):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/semver' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.semver.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules/fsevents/node_modules/set-blocking):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/set-blocking' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.set-blocking.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules/fsevents/node_modules/signal-exit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/signal-exit' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.signal-exit.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules/fsevents/node_modules/strip-json-comments):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/strip-json-comments' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.strip-json-comments.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules/fsevents/node_modules/util-deprecate):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/util-deprecate' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.util-deprecate.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules/fsevents/node_modules/wrappy):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/wrappy' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.wrappy.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules/fsevents/node_modules/yallist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/yallist' -> '/home/XXXXXXX/data/src/webassembly-rust/site/node_modules/fsevents/node_modules/.yallist.DELETE'

added 576 packages from 370 contributors and audited 8837 packages in 15.71s

19 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm install  10.52s user 1.98s system 77% cpu 16.096 total

実行します。

❯  npm run serve

> @ serve /home/XXXXXXX/data/src/webassembly-rust/site
> webpack-dev-server

ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/XXXXXXX/data/src/webassembly-rust/site
ℹ 「wdm」: Hash: 5628c9f645181fa020cd
Version: webpack 4.42.1
Time: 481ms
Built at: 2020-04-07 23:32:07
                           Asset      Size  Chunks                         Chunk Names
                      0.index.js  32.6 KiB       0  [emitted]              
fd5fc2029b770656cd8e.module.wasm  13.3 KiB       0  [emitted] [immutable]  
                        index.js   368 KiB    main  [emitted]              main
Entrypoint main = index.js
[0] multi (webpack)-dev-server/client?http://localhost:8080 ./index.js 40 bytes {main} [built]
[./index.js] 119 bytes {main} [built]
[./node_modules/@XXXXXXX/hello-wasm/hello_wasm.js] 2.38 KiB {0} [built]
[./node_modules/@XXXXXXX/hello-wasm/hello_wasm_bg.wasm] 13.2 KiB {0} [built]
[./node_modules/ansi-html/index.js] 4.16 KiB {main} [built]
[./node_modules/html-entities/index.js] 231 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:8080] (webpack)-dev-server/client?http://localhost:8080 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack-dev-server/node_modules/strip-ansi/index.js] (webpack)-dev-server/node_modules/strip-ansi/index.js 161 bytes {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
    + 24 hidden modules
ℹ 「wdm」: Compiled successfully.

アクセス

localhost:8080 にアクセスし、以下のメッセージが出ればOK。

wasm-rust-hello-world
wasm-rust-hello-world

Licensed under CC BY-NC-SA 4.0
最終更新 Sep 11, 2021
Built with Hugo
Theme Stack designed by Jimmy