The Nimiq Web Client ships with support for Vite.
Update your vite.config.js
:
import topLevelAwait from 'vite-plugin-top-level-await' // [!code ++]
import wasm from 'vite-plugin-wasm' // [!code ++]
export default defineConfig({
plugins: [
wasm(), // [!code ++]
topLevelAwait(), // [!code ++]
],
optimizeDeps: { // [!code ++]
exclude: ['@nimiq/core'], // [!code ++]
}, // [!code ++]
})
Now you are ready to go!