Replace an import statement with a macro.
This will remove the import statement from the final output and replace any function calls or template strings with the result returned by the macro
Search the reference...
/
property
Replace an import statement with a macro.
This will remove the import statement from the final output and replace any function calls or template strings with the result returned by the macro
{
"react-relay": {
"graphql": "bun-macro-relay"
}
}
Code that calls graphql will be replaced with the result of the macro.
import {graphql} from "react-relay";
// Input:
const query = graphql`
query {
... on User {
id
}
}
}`;
Will be replaced with:
import UserQuery from "./UserQuery.graphql"; const query = UserQuery;
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →