Skip to content

Commit 3242b35

Browse files
Merge pull request #39 from stephencookdev/feature/writing-tools
Documentation fix-ups + automation
2 parents 3240695 + d842d65 commit 3242b35

4 files changed

Lines changed: 1304 additions & 12 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_js:
44
script:
55
- npm run test
66
- npm run functional-test
7+
- npm run documentation-test
78
cache:
89
directories:
910
- "node_modules"

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Check out the [examples folder](/examples) for some more examples.
7171

7272
## Options
7373

74-
Options are (optionally) passed in to the constructor
74+
Pass these into the constructor, as an object:
7575

7676
```javascript
7777
const smp = new SpeedMeasurePlugin(options);
@@ -82,7 +82,9 @@ const smp = new SpeedMeasurePlugin(options);
8282
Type: `Boolean`<br>
8383
Default: `false`
8484

85-
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`
85+
If truthy, this plugin does nothing at all.
86+
87+
`{ disable: !process.env.MEASURE }` allows opt-in measurements with `MEASURE=true npm run build`.
8688

8789
### `options.outputFormat`
8890

@@ -94,7 +96,7 @@ Determines in what format this plugin prints its measurements
9496
* `"json"` - produces a JSON blob
9597
* `"human"` - produces a human readable output
9698
* `"humanVerbose"` - produces a more verbose version of the human readable output
97-
* If a function, it will call the function with the JSON blob being the first parameter, and just the response of the function as the output
99+
* If a function, it will call the function with the JSON blob, and output the response
98100

99101
### `options.outputTarget`
100102

@@ -133,14 +135,14 @@ const webpackConfig = smp.wrap({
133135
Type: `Boolean`<br>
134136
Default: `false`
135137

136-
If truthy, this plugin will attempt to break down the loader timing data to give per-loader timing information.
138+
By default, SMP measures loaders in groups. If truthy, this plugin will give per-loader timing information.
137139

138-
Points of note that the following loaders will have inaccurate results in this mode:
140+
This flag is _experimental_. Some loaders will have inaccurate results:
139141

140-
* 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
141-
* 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
142+
* loaders using separate processes (e.g. `thread-loader`)
143+
* loaders emitting file output (e.g. `file-loader`)
142144

143-
These are restrictions from technical limitations - ideally we would find solutions to these problems before removing the _(experimental)_ flag on this options
145+
We will find solutions to these issues before removing the _(experimental)_ flag on this option.
144146

145147
## License
146148

0 commit comments

Comments
 (0)