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"] },
);