import { defineConfig } from 'vite'; import wasmPack from 'vite-plugin-wasm-pack'; export default defineConfig({ // pass your local crate path to the plugin plugins: [wasmPack('./my-crate')] }); Add script to package.json "scripts": { "dev": "vite", "build": "vite build" }...
Add the plugin to yourvite.config.jsfile import{defineConfig}from'vite'importvitePluginWasmPackfrom'@zebing/vite-plugin-wasm-pack';exportdefaultdefineConfig({plugins:[vitePluginWasmPack({crateDirectory:'./my_crate'})]}) import crate in your code ...
when wasm-pack isn't present it fails with something like: /home/a/Code/wasm/node_modules/@wasm-tool/wasm-pack-plugin/plugin.js:210 reject(new Error("Rust compilation.")); ^ Error: Rust compilation. at ChildProcess.<anonymous> (/home/a/Code/wasm/node_modules/@wasm-tool/wasm-pack-plug...
问找不到模块'webpack/lib/web/FetchCompileWasmTemplatePlugin‘EN有一天我突然意识到一个问题,在使用r...
vue2 项目安装报错找不到webpack/lib/web/FetchCompileWasmTemplatePlugin 解决办法: 把package.json 的东西复制出来,删掉这俩文件,再npm init一下,再把package.json的东西粘贴回去,再npm install。
Invoke WasmPackPlugin build: nothing Invoke cargo-check: full rebuild Invoke WasmPackPlugin build: full rebuild ... And yeah, this only happens if mode: 'development' and .cargo/config with a compiler flag is present. My take on what happens: I'm pretty sure it is somehow triggered by ...
plugin.d.ts seems to have conflicting exports that cause TypeScript errors. The errors: node_modules/@wasm-tool/wasm-pack-plugin/plugin.d.ts:23:1 - error TS2309: An export assignment cannot be used in a module with other exported element...