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

ESM Support #43

Open
jasonkuhrt opened this issue Mar 21, 2023 · 1 comment
Open

ESM Support #43

jasonkuhrt opened this issue Mar 21, 2023 · 1 comment

Comments

@jasonkuhrt
Copy link

I don't think this package works in a NodeNext TS ESM project context:

CleanShot 2023-03-21 at 14 03 48@2x

@jasonkuhrt
Copy link
Author

This is one fix:

{
  "name": "@cloudflare/pages-plugin-honeycomb",
  "version": "1.0.2",
  "type": "module",
  "exports": {
    "." : {
      "import": "./index.js",
      "require": "./index.js",
      "types": "./index.d.ts"
    }
  },
  "files": [
    "index.js",
    "index.d.ts",
    "tsconfig.json"
  ],
  "scripts": {
    "build": "npx wrangler pages functions build --plugin --outfile index.js"
  },
  "dependencies": {
    "@cloudflare/workers-honeycomb-logger": "^2.3.3"
  }
}

If you need a dedicated CJS build then point to it with require and toss a package.json into the directory therein with "type": "commonjs".

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