nikku / feelin

A DMN FEEL parser and interpreter written in JavaScript
MIT License
40 stars 10 forks source link

Incorrect bundling #23

Closed Kimbo0o closed 1 year ago

Kimbo0o commented 1 year ago

Describe the Bug

The package.json file specifies "type": "module", but entry point uses commonjs (require Syntax). This causes errors when you try to test with vitest, see also: https://github.com/vitest-dev/vitest/issues/4007#issuecomment-1691096627

Steps to Reproduce

  1. Take a look at type definition in package.json
  2. See wrong Syntax in index.json https://www.npmjs.com/package/feelin?activeTab=code

Expected Behavior

The package.json should state "type": "commonjs" or the index.json file should be ESM Syntax. See also: https://nodejs.org/api/packages.html

Environment

sheremet-va commented 1 year ago

The package.json should state "type": "commonjs" or the index.json file should be ESM Syntax

Adding exports field to package.json with the correct entry points might also help. And don't forget to use different extensions for CJS/ESM.

nikku commented 1 year ago

Sounds great. We want to use cjs for CommonJS files.

Happy to take a contribution that fixes this.