danielwaltz / vite-plugin-graphql-codegen

Zero-config vite plugin that uses the vite file watcher to run graphql codegen programmatically without needing to start a separate watcher
https://www.npmjs.com/package/vite-plugin-graphql-codegen
MIT License
83 stars 8 forks source link

Add ESM export #25

Closed DanielleHuisman closed 1 year ago

DanielleHuisman commented 1 year ago

Vite 5 prints warnings for any plugins still using CJS imports. This PR adds an ESM export, which resolves the warning.

Trace: The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
    at warnCjsUsage (/redacted/node_modules/vite/index.cjs:32:3)
    at Object.<anonymous> (/redacted/node_modules/vite/index.cjs:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/redacted/node_modules/vite-plugin-graphql-codegen/dist/index.js:29:20)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
danielwaltz commented 1 year ago

Thanks for this! I saw the warnings but wasn't quite sure what the reason was. This looks good, but it does need to use the conventional commits format in order for CI to detect this as a change to release.

I would say just updating the commit message to fix: support esm would be perfect! I can also take this change and release it myself marking you as a co-contributor if you would prefer.

DanielleHuisman commented 1 year ago

I updated the commit message.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.3.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: