Skip to content

Rust编译及输出优化 #19

@honwhy

Description

@honwhy

大致浏览器了js端如果使用wasm的,如md5

MD5Algo.wasm = await loadWasm(wasmBytes);

而这个wasmBytes 应该就是在做来自Rust项目编译后的内容,

// file: md5_wasm.js
import { generateWasmBytes } from '../../utils/wasm-utils';

export const wasmBytes = generateWasmBytes('eJy1XH+cVcV1n5l736+977EXREUWZd4VFVRgf79dNA13FZASgp9+...');

有没有可能在Rust编译后,将输出产物写入到一个文件,,然后在 md5_wasm.js 中类似Vite 那种方式

import wasmStrings from './md5_build.wasm?raw' 

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