satellite/console/wasm: reduce size to <9MB
Make changes so that we only import the necessary files from the console package so that the generated wasm code is as small as possible. This change gets the compiled wasm code down to 8.6MB uncompressed and 2MB when compressed with `gzip --best`. https://review.dev.storj.io/c/storj/storj/+/3396 Change-Id: Ifdd4be285810757b46bbbe43327c0d0139e5f8f7
This commit is contained in:
parent
d955946f15
commit
3cc98de3ee
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@
|
||||
*.so
|
||||
*.dylib
|
||||
*.db
|
||||
*.wasm
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2020 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
package console
|
||||
package consolewasm
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2020 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
package console_test
|
||||
package consolewasm_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -10,7 +10,7 @@ import (
|
||||
|
||||
"storj.io/common/testcontext"
|
||||
"storj.io/storj/private/testplanet"
|
||||
"storj.io/storj/satellite/console"
|
||||
console "storj.io/storj/satellite/console/consolewasm"
|
||||
)
|
||||
|
||||
// TestGenerateAccessGrant confirms that the access grant produced by the wasm access code
|
@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2020 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
package console
|
||||
package consolewasm
|
||||
|
||||
import (
|
||||
"time"
|
@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2020 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
package console_test
|
||||
package consolewasm_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@ -13,7 +13,7 @@ import (
|
||||
"storj.io/common/rpc/rpcstatus"
|
||||
"storj.io/common/testcontext"
|
||||
"storj.io/storj/private/testplanet"
|
||||
"storj.io/storj/satellite/console"
|
||||
console "storj.io/storj/satellite/console/consolewasm"
|
||||
"storj.io/uplink"
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/zeebo/errs"
|
||||
|
||||
"storj.io/storj/satellite/console"
|
||||
console "storj.io/storj/satellite/console/consolewasm"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user