flagsmith-js-client icon indicating copy to clipboard operation
flagsmith-js-client copied to clipboard

Bundle ES(flagsmith-es) and combine with standard CJS module (flagsmith)

Open kyle-ssg opened this issue 1 year ago • 0 comments

At the moment, users who wish to use our es module need to install flagsmith-es. We should combine the modules together.

Doing this will also solve an issue with SvelteKit + OpenFeature, since Svelte expects es modules and OpenFeature comes bundled with flagsmith which is throwing errors expecting flagsmith to be a module.

I can't seem to figure out how to do this at the moment but it will involve adjusting rollup and instructing package.json on how to deal with this e.g.

"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
"exports": {
    ".": {
        "import": "./dist/mjs/index.js",
        "require": "./dist/cjs/index.js"
    }
},

kyle-ssg avatar Apr 24 '24 10:04 kyle-ssg