Skip to content

Commit a8318c6

Browse files
committed
Merge pull request django-webpack#8 from basicdays/master
Add indent option, supply missing license field in package.json
2 parents fdf5aec + dd25062 commit a8318c6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,10 @@ And in case `logTime` option is set to `true`, the output will look like,
9191
"endTime":1440535326804
9292
}
9393
```
94+
95+
96+
97+
By default, the output JSON will not be indented. To increase readability, you can use the `indent`
98+
option to make the output legible. By default it is off. The value that is set here will be directly
99+
passed to the `space` parameter in `JSON.stringify`. More information can be found here:
100+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Plugin.prototype.writeOutput = function(compiler, contents) {
8686
contents.publicPath = compiler.options.output.publicPath;
8787
}
8888
mkdirp.sync(path.dirname(outputFilename));
89-
fs.writeFileSync(outputFilename, JSON.stringify(contents));
89+
fs.writeFileSync(outputFilename, JSON.stringify(contents, null, this.options.indent));
9090
};
9191

9292
module.exports = Plugin;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "webpack-bundle-tracker",
33
"version": "0.0.9",
44
"description": "Spits out some stats about webpack compilation process to a file",
5+
"license": "MIT",
56
"main": "index.js",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"

0 commit comments

Comments
 (0)