Setting up offline local DB for mobile game with Webpack and TS

I am trying to make a data-driven multi-platform (mobile/desktop) strategy game. It won’t be on the, browser so the localstorage isn’t an option for me. The players should be able to save their progress in a local file ,(json or ideally a relational DB like SQLite3). I started with a webpack/typescript template. I’ve been trying to implement various databases such as SQLite3, Postgres, and Lowdb but I can’t seem to make them work. Always getting errors like require is not defined , which is apparently due to the browser not being able to communicate with the databases.

I’m wondering if there are any working examples of a local DB set up with webpack or other bundlers. Any ideas or help are appreciated.

I actually posted my question and added my configs on StackOverflow with the error messages if you are interested in checking it out:

Thanks!