Skip to content

When run build in vite, it doesnt work in production #1393

@ticky-xia

Description

@ticky-xia

In Vite, I use vite-plugin-wasm in dev env, and everything works well,but if I run build , the /bunlder/index.js looks like doesnt init the WebAssembly.Then I found the sideEffects option in package.json when run build.tree-shaking will remove the init code __wbg_set_wasm(wasm). The source code looks like below:

Image

It should be like:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions