You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The released @taplo/lib contains a 35.6MB index.js, which is too big.
The cause seems to be the config debug: process.env["RELEASE"] !== "true" is not working as expected in CI.
Details
My friend and I want to use @taplo/lib in our projects, but 35.6MB is too big. So, I did some simple tests to try to find out why.
Compile taplo-wasm directly with Cargo
Since @taplo/lib includes the compiled wasm of taplo-wasm, I use Cargo to compile the crate directly to see the file size of the wasm. Here are the results:
$ ls target/wasm32-unknown-unknown/debug -alh-rwxrwxr-x 2 duskmoon duskmoon 30M Aug 27 03:14 taplo_wasm.wasm
$ ls target/wasm32-unknown-unknown/release/ -alh-rwxrwxr-x 2 duskmoon duskmoon 5.6M Aug 27 03:18 taplo_wasm.wasm
If the wasm is compiled in release mode, it should be about 6MB instead of 35.6MB. So I assume the configuration is incorrect.
Compile @taplo/lib with modified config
I modified rollup.config.mjs to set debug to false. This ensures the code is built in release mode. And here is the output:
$ ls dist -alhtotal 6.6Mdrwxrwxr-x 2 duskmoon duskmoon 4.0K Aug 27 03:14 .drwxrwxr-x 4 duskmoon duskmoon 4.0K Aug 27 03:17 ..-rw-rw-r-- 1 duskmoon duskmoon 4.8K Aug 27 03:18 index.d.ts-rw-rw-r-- 1 duskmoon duskmoon 6.5M Aug 27 03:18 index.js
The output index.js is only 6.5MB.
The CI config
In the releases.yaml, the step to build and publish is:
TL;DR
The released
@taplo/lib
contains a 35.6MBindex.js
, which is too big.The cause seems to be the config
debug: process.env["RELEASE"] !== "true"
is not working as expected in CI.Details
My friend and I want to use
@taplo/lib
in our projects, but 35.6MB is too big. So, I did some simple tests to try to find out why.Compile
taplo-wasm
directly with CargoSince
@taplo/lib
includes the compiled wasm oftaplo-wasm
, I use Cargo to compile the crate directly to see the file size of the wasm. Here are the results:If the wasm is compiled in release mode, it should be about 6MB instead of 35.6MB. So I assume the configuration is incorrect.
Compile
@taplo/lib
with modified configI modified
rollup.config.mjs
to setdebug
tofalse
. This ensures the code is built in release mode. And here is the output:The output
index.js
is only 6.5MB.The CI config
In the
releases.yaml
, the step to build and publish is:We might need to add
RELEASE: true
to the env section to use the release mode.The text was updated successfully, but these errors were encountered: