agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications

Home Page:https://agile-ts.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AgileTs esm is transformed into commonjs instead of using the commonjs files directly

bennoinbeta opened this issue Β· comments

commented

πŸ› Bug report

πŸ€– Current Behavior

AgileTs isn't importable into commonjs
-> esm modules are imported and then transformed into commonjs which causes issues (like see image)
image

🎯 Expected behavior

AgileTs should be importable into commonjs without problems

πŸ“„ Reproducible example

AgileTs documentation

πŸ’‘ Suggested solution(s)

https://the-guild.dev/blog/support-nodejs-esm

  "exports": {
    "./package.json": "./package.json",
    ".": {
      "types": "./dist/index.d.ts",
      "module": "./dist/esm/index.js",
      "default": "./dist/index.js"
    },
    "./*": {
      "types": "./*.d.ts",
      "module": "./esm/*.js",
      "default": "./*.js"
    }
  },

Specify what export to use in which import scenario.

commented

image

commented

Has something to do with nasty circular dependencies..