graphql-mesh
graphql-mesh copied to clipboard
Add `.js` extension for artifacts import (ESM compatability)
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [ ] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
Make sure to fork this template and run
yarn generatein the terminal.Please make sure Mesh package versions under
package.jsonmatches yours.
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
Describe the bug
Bundling a package with Mesh artifacts as ESM results in error, since the hardcoded paths in the artifacts are missing .js extension
To Reproduce Steps to reproduce the behavior:
- Create a basic Mesh example with local sources (e.g the json-schema-example)
- Generate artifact
- Create ESM bundle
- Try to run the bundled artifact
Expected behavior
Bundled artifacts should fully support ESM
ESM is currently supported. with the NODE_OPTIONS=\"--loader ts-node/esm\" mesh build command.
@ardatan can we maybe migrate this var to the configuration file?