You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If truthy, this plugin does nothing at all. It is recommended to set this with something similar to `{ disable: !process.env.MEASURE }` to allow opt-in measurements with a `MEASURE=true npm run build`
93
80
94
81
### `options.outputFormat`
95
82
@@ -111,9 +98,44 @@ Default: `console.log`
111
98
* If a string, it specifies the path to a file to output to.
112
99
* If a function, it will call the function with the output as the first parameter
113
100
114
-
### `options.disable`
101
+
### `options.pluginNames`
102
+
103
+
Type: `Object`<br>
104
+
Default: `{}`
105
+
106
+
By default, SMP derives plugin names through `plugin.constructor.name`. For some
107
+
plugins this doesn't work (or you may want to override this default). This option
108
+
takes an object of `pluginName: PluginConstructor`, e.g.
109
+
110
+
```javascript
111
+
constuglify=newUglifyJSPlugin();
112
+
constsmp=newSpeedMeasurePlugin({
113
+
pluginNames: {
114
+
customUglifyName: uglify
115
+
}
116
+
});
117
+
118
+
constwebpackConfig=smp.wrap({
119
+
plugins: [
120
+
uglify
121
+
]
122
+
});
123
+
```
124
+
125
+
### `options.granularLoaderData`_(experimental)_
115
126
116
127
Type: `Boolean`<br>
117
128
Default: `false`
118
129
119
-
If truthy, this plugin does nothing at all. It is recommended to set this with something similar to `{ disable: !process.env.MEASURE }` to allow opt-in measurements with a `MEASURE=true npm run build`
130
+
If truthy, this plugin will attempt to break down the loader timing data to give per-loader timing information.
131
+
132
+
Points of note that the following loaders will have inaccurate results in this mode:
133
+
134
+
* loaders using separate processes (e.g. `thread-loader`) - these make it difficult to get timing information on the subsequent loaders, as they're not attached to the main thread
135
+
* loaders emitting file output (e.g. `file-loader`) - the time taken in outputting the actual file is not included in the running time of the loader
136
+
137
+
These are restrictions from technical limitations - ideally we would find solutions to these problems before removing the _(experimental)_ flag on this options
0 commit comments