ARnft icon indicating copy to clipboard operation
ARnft copied to clipboard

Unnessasarry comment inside of dist/ARnft.js

Open tkapu opened this issue 3 years ago • 4 comments

If you look into the ARnft.js file, then you will notice that about half the file is just commented out Base64 code. I think, that should be removed to reduce the file size. ~1800kb to about ~750kb

tkapu avatar Jul 22 '22 12:07 tkapu

Hi @tkapu ARnft is based on webarkit/jsartoolkitNFT the base64 code that you were reading is the WASM bitecode bundled with webpack, if you remove that code you will remove the core of it. Probably it is possible to reduce jsartoolkitNFT WASM code reducing emscripten code, but this is not a prority for me.

kalwalt avatar Oct 08 '22 18:10 kalwalt

Hi @kalwalt, i checked the files in the dist folder of webarkit/jsartoolkitNFT and they look fine. Are you sure, that the ARnft.js file is clean? When i open it with a file editor, the second line starts with //# and when i remove that line completely everything works fine, as before. When i use a minifier tool on the code, then it remove that comment/code as well.

tkapu avatar Oct 18 '22 10:10 tkapu

I used the TerserPlugin as you can see https://github.com/webarkit/ARnft/blob/5a669820c6ea8fe088a344492bff14592dc201d3/webpack.config.js#L48-L56 I don't see this second line. Maybe have you build the distribution library with the dev option?

kalwalt avatar Oct 22 '22 14:10 kalwalt

I'm using "yarn build-ts" from the readme file. I was missing the optimization part, but it didn't change my result.

You can see the second line in the file hear on github

tkapu avatar Oct 25 '22 08:10 tkapu