温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/TranspilerOptions/macro
点击访问原文链接

property macro | Bun module | Bun

property macro | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/TranspilerOptions/macroPmacro

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/TranspilerOptions/macroPmacro

property

TranspilerOptions.macromacro?: MacroMap

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 StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

property macro | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    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