Open Seancheey opened 1 year ago
I tried this
import pkg from 'js-sha3';
const { sha3_512 } = pkg;
it works
Can you give an example project?
I tried this
import pkg from 'js-sha3'; const { sha3_512 } = pkg;
it works
Can you give an example project?
Thanks for quick response, yes,
vite
is working fine for that method, but vite build
then executing production package will raise an error.
I use npm run build
and got no error.
Environment
Sveltekit + Vite + NPM
Attempt 1
I tried to import with
but
npm run build
gives me an error message:Attempt 2
However, when I switch to
I found this runtime error:
My Guess
I doubt the sha3_512 function is tree-shaked by vite compiler, but I'm not sure why.
Possible fix
package.json
?vite build
won't tree-shake the function?