thearkxd / ark.db

Small and fast JSON database for Node and browser. 😋
https://www.npmjs.com/package/ark.db
71 stars 3 forks source link

Your treeshaking is not working? #5

Open Mehdi-Hp opened 3 years ago

Mehdi-Hp commented 3 years ago

I'm building this simple file, using vite (practically rollup)

import { LocalStorage } from 'ark.db';

const datastore = new LocalStorage();

function read(dataPath) {
    return datastore.get(dataPath);
}

function write(dataPath, payload) {
    return datastore.set(
        dataPath,
        (payload?.(datastore.get(dataPath)) || payload)
    );
}

export {
    read,
    write
};

Now, my production build is 972.25kb!
It seems the whole Mongoose is in the ark.db's production build.

thearkxd commented 2 years ago

How are you included the ark.db in your project?