Closed KonradHoeffner closed 2 years ago
Yes, you can use level-js in Vite
Install
npm install levelup level-js
Put it in front of the code,
import { Buffer } from 'buffer';
// @ts-ignore
window.global = window;
// @ts-ignore
window.Buffer = Buffer;
add plugins in vite.config.js
import nodePolyfills from 'rollup-plugin-polyfill-node';
{
plugins: [nodePolyfills()]
}
Can level-js be used with Vite? If yes, how? I tried
npm install level-js
andimport leveljs from "level-js";
butnpm run dev
reportserror: Do not know how to load path: level-js
.