Skip to content

pantoken / bundlers/vite/src / pantoken

دالة: pantoken()

pantoken(options?): Plugin

تجريبي

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

المعلمات

options?

PantokenViteOptions = {}

PantokenViteOptions.

القيم المرجعة

Plugin

إضافة Vite Plugin.

أمثلة

سجّل الإضافة في 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