This plugin provides support for [@namada/sdk-multicore](../sdk-multicore) features in Vite development mode. The multicore SDK utilizes WebWorkers to provide "threaded" features, and needs to be able to find and dynamically load `workerHelpers.js` script
npm install @namada/vite-esbuild-pluginThis plugin provides support for @namada/sdk-multicore features in Vite development mode. The multicore
SDK utilizes WebWorkers to provide "threaded" features, and needs to be able to find and
dynamically load workerHelpers.js scripts as provided by wasm-bindgen-rayon.
To use this plugin, install @namada/vite-esbuild-plugin as a dev-dependency:
``bashNPM
npm install --save-dev @namada/vite-esbuild-plugin
Usage
In
vite.config.ts, invoke as follows:`typescript
import { sdkMulticoreWorkerHelpers } from "@namada/vite-esbuild-plugin";export default defineConfig({
optimizeDeps: {
esbuildOptions: {
// Use this plugin to handle the SDK multicore worker helpers
plugins: [sdkMulticoreWorkerHelpers()],
},
},
});
``