@zk-tech/rrt-plugin-rspack 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @zk-tech/rrt-plugin-rspack
2
+
3
+ Rspack plugin for ReactRenderTracker.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add -D @zk-tech/rrt-plugin-rspack @rspack/core
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ // rspack.config.js
15
+ const { rspack } = require('@rspack/core');
16
+ const { PerfMonitorRspackPlugin } = require('@zk-tech/rrt-plugin-rspack');
17
+
18
+ module.exports = {
19
+ plugins: [
20
+ new rspack.HtmlRspackPlugin({
21
+ template: './index.html',
22
+ }),
23
+ new PerfMonitorRspackPlugin({
24
+ diffMode: 'lite',
25
+ updateTrace: true,
26
+ commitTrace: true,
27
+ // rendererId: 1,
28
+ // disabled: process.env.NODE_ENV === 'production',
29
+ }),
30
+ ],
31
+ };
32
+ ```
33
+
34
+ `PerfMonitorRspackPlugin` requires `rspack.HtmlRspackPlugin` and should be placed after it.
35
+
36
+ ## Options
37
+
38
+ - `disabled?: boolean`
39
+ - `rendererId?: number`
40
+ - `diffMode?: 'off' | 'lite' | 'full'`
41
+ - `updateTrace?: boolean`
42
+ - `commitTrace?: boolean`
@@ -0,0 +1,2 @@
1
+ export declare const coreSrc = "perf-monitor-core.bundle.js";
2
+ export declare const clientSrc = "perf-monitor-client.bundle.js";