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
Copy file name to clipboardExpand all lines: README.md
+8-13Lines changed: 8 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,23 @@
3
3
4
4
Spits out some stats about webpack compilation process to a file.
5
5
6
-
<br>
7
-
8
6
## Install
9
7
10
8
```bash
11
9
npm install --save-dev webpack-bundle-tracker
12
10
```
13
11
14
-
<br>
15
-
16
12
## Compatibility
17
13
18
14
This project is compatible with NodeJS versions 12 and up.
19
15
20
-
21
-
<br>
16
+
## Migrating from version 1.x.y to 2.x.y
17
+
Starting on version 2.0.0, when creating a new instance of `BundleTracker`, the usage of the `path` parameter has been fixed and it's now being used to generate the output path for the stats file, together with the `filename` parameter. On version 2.0.0, if the `path` parameter is ommited from the constuctor call, it will attempt to place the stats file at the `output.path` directory (if also ommited, will use `'.'` as a fallback). Also, version 2.0.0 doesn't allow sub-directories to be included on the `filename`, only allowing to include them on the `path` param. To avoid those issues, when migrating, double-check if the file placement is as expected. The usage of these parameters is documented [here](#usage) and [here](#options).
22
18
23
19
## Usage
24
20
25
21
```javascript
22
+
var path =require('path');
26
23
var BundleTracker =require('webpack-bundle-tracker');
@@ -175,13 +172,11 @@ By default, the output JSON will not be indented. To increase readability, you c
175
172
option to make the output legible. By default it is off. The value that is set here will be directly
176
173
passed to the `space` parameter in `JSON.stringify`. More information can be found [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
|`path`|`{String}`|`'.'`| Output directory of bundle tracker JSON file. |
179
+
|`path`|`{String}`|`'.'`| Output directory of bundle tracker JSON file. Will attempt to use `output.path` before falling back to the default value. |
185
180
|`filename`|`{String}`|`'webpack-stats.json'`| Name of the bundle tracker JSON file. |
186
181
|`publicPath`|`{String}`| (ignored) | Override `output.publicPath` from Webpack config. |
187
182
|`relativePath`|`{Boolean}`|`false`| Show relative path instead of absolute path for bundles in JSON Tracker file. Path are relative from path of JSON Tracker file. |
0 commit comments