fix(js/scripts/build.sh): fix wasm init problem when run build in vite(#1393)#1396
Open
ticky-xia wants to merge 1 commit into
Open
fix(js/scripts/build.sh): fix wasm init problem when run build in vite(#1393)#1396ticky-xia wants to merge 1 commit into
ticky-xia wants to merge 1 commit into
Conversation
Added sideEffects field to package.json update.
Member
|
Thanks! Can you provide some sort of reference that shows this is needed? |
kylebarron
requested changes
Dec 5, 2025
kylebarron
left a comment
Member
There was a problem hiding this comment.
I think we only want this to apply to the code in bundler/ and not in all three submodules.
If you run
wasm-pack build --out-dir tmp_build/node \
--out-name index \
--target nodejs
then the generated module does not have a .sideEffects field.
And if you build for the web endpoint,
wasm-pack build --out-dir tmp_build/esm \
--out-name index \
--target web
then the generated package.json only has "./snippets/*" in the side effects; index.js is not included in the sideEffects array.
So I think you need to set
.sideEffects: [
"bundler/index.js",
"bundler/snippets/*",
"node/snippets/*"
]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Added sideEffects field to package.json update.
Closes #1393