Installation and usage

Profiler can be used directly through CDN or installed using CLI like NPM or YARN.

Installation

CLI:

yarn add -D @stylify/profiler
npm i -D @stylify/profiler

CDN:

<script src="https://cdn.jsdelivr.net/npm/@stylify/profiler@latest/dist/profiler.min.js"></script>

Usage

Profiler can be used only in the browser. Primarily it takes data from Runtime. When Runtime is not detected, it searches for data in script tags with a class stylify-profiler-data. These script tags must provide a valid json that is then parsed and used inside the profiler.

import { Runtime } from '@stylify/runtime';
import { Profiler } from '@stylify/profiler';

// Profiler should be loaded before Runtime is initialized (if Runtime is present)
new Profiler();
new Runtime();