Skip to content

pantoken-root / bundlers/vite/src / pantoken

دالة: pantoken() ​

pantoken(options?): Plugin

Experimental

ملحق Vite الخاص بـ pantoken.

Parameters ​

options? ​

PantokenViteOptions = {}

PantokenViteOptions.

Returns ​

Plugin

إضافة Vite Plugin.

Examples ​

سجّل الإضافة في vite.config.ts

ts
import { defineConfig } from "vite";
import { pantoken } from "@pantoken/vite";

export default defineConfig({
  plugins: [pantoken()],
});

حقن ورقة الأنماط تلقائيًا في HTML <head>

ts
import { defineConfig } from "vite";
import { pantoken } from "@pantoken/vite";

export default defineConfig({
  // No need to import `virtual:pantoken/css` yourself — it's injected.
  plugins: [pantoken({ injectCss: true })],
});

استخدم الوحدات الافتراضية في كود التطبيق

ts
import css from "virtual:pantoken/css"; // the stylesheet string
import { tokens } from "virtual:pantoken/tokens"; // the resolved token IR