Skip to content

pantoken / bundlers/next/src / withPantoken

函数: withPantoken()

withPantoken(nextConfig?, options?): NextConfigLike

实验性

封装 Next.js 配置,使 Instructure UI 包被转译。

参数

nextConfig?

NextConfigLike = {}

现有的 Next 配置(默认 {})。

options?

WithPantokenOptions = {}

WithPantokenOptions.

返回值

NextConfigLike

增强后的配置。

示例

封装你的 next.config.mjs

js
import { withPantoken } from "@pantoken/next";

export default withPantoken({ reactStrictMode: true });

转译额外的 InstUI 包

js
import { withPantoken } from "@pantoken/next";

export default withPantoken(
  { reactStrictMode: true },
  { transpile: ["@instructure/ui-modal"] },
);