Skip to content

Commit 28266f8

Browse files
Add README
1 parent e22d252 commit 28266f8

2 files changed

Lines changed: 100 additions & 4 deletions

File tree

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Speed Measure Webpack Plugin
2+
3+
**_(this plugin is not yet stable, and not safe for production)_**
4+
5+
**_(so far tested only with webpack@3.10.0, node@8.9.4)_**
6+
7+
This plugin measures your webpack build speed, giving an output like this:
8+
9+
```
10+
----------------------------
11+
General output time took 1.01 minutes
12+
13+
IgnorePlugin took 0.62 seconds
14+
ForceCaseSensitivityPlugin took 20.27 seconds
15+
SpriteLoaderPlugin took 30 milliseconds
16+
ExtractTextPlugin took 9.44 seconds
17+
DefinePlugin took 1 milliseconds
18+
19+
thread-loader, and
20+
babel-loader took 0.56 minutes
21+
Med = 401 milliseconds,
22+
x̄ = 1.08 seconds,
23+
σ = 0.57 seconds,
24+
range = (268 milliseconds, 2.49 seconds),
25+
n = 247
26+
file-loader took 7.11 seconds
27+
Med = 1.41 seconds,
28+
x̄ = 1.26 seconds,
29+
σ = 436 milliseconds,
30+
range = (340 milliseconds, 2.02 seconds),
31+
n = 29
32+
----------------------------
33+
```
34+
35+
# Getting Started
36+
37+
`npm install --save-dev speed-measure-webpack-plugin`
38+
39+
Change your webpack config from
40+
41+
```
42+
{
43+
entry: {...},
44+
output: {...},
45+
module: {...},
46+
plugins: [
47+
new MyPlugin(),
48+
new MyOtherPlugin()
49+
]
50+
}
51+
```
52+
53+
to
54+
55+
```
56+
{
57+
entry: {...},
58+
output: {...},
59+
module: {...},
60+
plugins: SpeedMeasurePlugin.wrapPlugins({
61+
MyPlugin: new MyPlugin(),
62+
MyOtherPlugin: new MyOtherPlugin()
63+
})
64+
}
65+
```
66+
67+
Or you can also specify config:
68+
69+
```
70+
{
71+
entry: {...},
72+
output: {...},
73+
module: {...},
74+
plugins: SpeedMeasurePlugin.wrapPlugins({
75+
MyPlugin: new MyPlugin(),
76+
MyOtherPlugin: new MyOtherPlugin()
77+
}, {
78+
outputFormat: "human",
79+
outputTarget: "myFile.txt"
80+
})
81+
}
82+
```
83+
84+
## `outputFormat` ##
85+
86+
(default `"json"`)
87+
88+
* `"json"` - produces a JSON blob
89+
* `"human"` - produces a human readable output
90+
91+
## `outputTarget` ##
92+
93+
(default `null`)
94+
95+
* `null` - prints to `console.log`
96+
* `"foo"` - prints (and makes, if no file exists) to the file at location `"foo"`

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.0.1",
44
"description": "A Webpack plugin, to help measure the speed of your other loaders and plugins",
55
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
96
"repository": {
107
"type": "git",
118
"url": "git+https://github.com/stephencookdev/speed-measure-webpack-plugin.git"
129
},
13-
"author": "",
10+
"author": {
11+
"name": "Stephen Cook",
12+
"email": "stephen@stephencookdev.co.uk"
13+
},
1414
"license": "ISC",
1515
"bugs": {
1616
"url": "https://github.com/stephencookdev/speed-measure-webpack-plugin/issues"

0 commit comments

Comments
 (0)