agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications
https://agile-ts.org
MIT License
95 stars 8 forks source link

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

Closed bennobuilder closed 3 years ago

bennobuilder commented 3 years ago

🐛 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.

bennobuilder commented 3 years ago

image

bennobuilder commented 3 years ago

Has something to do with nasty circular dependencies..