إضافة البروفايلات

انشاء ملف كروم يحتوي اوقات تنفيذ الإضافات، يُخرج ملف events.json إفتراضياً. من الممكن اضافة ملف مخصص بإستعمال خيار outputPath

ملاحظة: إضافة البروفايلات تقبل فقط مسارات حتمية

الخيارات

  • outputPath: مسار حتمي لملف مخصص بصيغة (json)

الاستعمال: إفتراضياً

new webpack.debug.ProfilingPlugin();

الاستعمال: مخصص outputPath

import path from "node:path";
import { fileURLToPath } from "node:url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

new webpack.debug.ProfilingPlugin({
  outputPath: path.join(__dirname, "profiling/profileEvents.json"),
});

لعرض ملف البروفايل:

  1. شغل webpack مع ProfilingPlugin.

  2. افتح متصفح كروم، افتح ادوات المطور، اذهب الى نافذة الأداء (Performance) سابقاً (Timeline)

  3. اسحب وافلت الملف المولّد (events.jsonافتراضياً) في ال profiler.

    سيعرض الجدول الزمني الاحصائيات والاستدعاءات لكل اضافة!

Edit this page·

1 Contributor

MohaDev-69