Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports CJS #34

Closed
jaikme opened this issue May 11, 2023 · 0 comments
Closed

Exports CJS #34

jaikme opened this issue May 11, 2023 · 0 comments

Comments

@jaikme
Copy link

jaikme commented May 11, 2023

I'm really enjoyed this package, but can you help me with something?

I'm trying to use this package with ts-node, but it rejects the "exports": "./index.js" of the package because my compilerOptions.module need to be a CJS.

I'm here to suggest ship ESM & CJS with the following configuration:

ansi-escapes/package.json

"type": "module",
"exports": {
  "import": "./index.js",
  "require": "./dist/index.cjs"
},
"scripts": {
  ...
  "build": "tsup src/index.js",
  "prepublishOnly": "npm run build"
},
"files": [
  "dist",
  "index.js",
  "index.d.ts"
],
"devDependencies": {
  ...
  "tsup": "^6.7.0",
}

I used tsup here, but have other means like unbuild

wrap-ansi have the same issue

Is this viable ? Need help ?

@jaikme jaikme closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant