merge-jsons-webpack-plugin
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -10,2 +10,3 @@ "use strict"; | ||
constructor(options) { | ||
this.fileDependencies = []; | ||
this.apply = (compiler) => { | ||
@@ -51,3 +52,3 @@ compiler.plugin('emit', (compilation, done) => { | ||
this.processFiles = (compilation, files, outputPath) => { | ||
this.fileDependencies = files; | ||
this.fileDependencies = this.fileDependencies.concat(files); | ||
var fileContents = files.map(this.readFile); | ||
@@ -54,0 +55,0 @@ let mergedContents = {}; |
{ | ||
"name": "merge-jsons-webpack-plugin", | ||
"description": "This plugin is used to merge json files into single json file,using glob or file names", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "email": "sudharsan_tk@yahoo.co.in", |
@@ -35,32 +35,28 @@ # Merge json files | ||
1. **By files** | ||
1. **By files** | ||
If you want to merge group of files use like this. | ||
````javascript | ||
new MergeJsonWebpackPlugin({ | ||
"files": ['./jsons/file1.json', | ||
'./jsons/file3.json', | ||
'./jsons/file2.json'], | ||
"output":{ | ||
"fileName":"./dist/result.json" | ||
} | ||
}) | ||
```` | ||
``` | ||
new MergeJsonWebpackPlugin | ||
({ | ||
"files": ['./jsons/file1.json','./jsons/file3.json','./jsons/file2.json'], | ||
"output":{ | ||
"fileName":"./dist/result.json" | ||
} | ||
}) | ||
``` | ||
| Field Name | Description | | ||
|----------------- |---------------------------------- | | ||
| files | Array of json files to be merged | | ||
| output.fileName | Name of merged output file ,relative path from output.path entry | | ||
| encoding | Optional,encoding to be used default is utf-8 | | ||
| Field Name | Description | | ||
|----------------- |---------------------------------- | | ||
| files | Array of json files to be merged | | ||
| output.fileName | Name of merged output file ,relative path from output.path entry | | ||
| encoding | Optional,encoding to be used default is utf-8 | | ||
2. **By Patterns** | ||
This plugin uses glob for searching file patterns,please refer glob for usage for sample pattern. | ||
You can specify a pattern to pull all the files that satify the particular pattern and output a single json file. | ||
2. **By Patterns** | ||
This plugin uses glob for searching file patterns,please refer glob for usage for sample pattern. You can specify a pattern to pull all the files that satify the particular pattern and output a single json file. | ||
````javascript | ||
``` | ||
new MergeJsonWebpackPlugin({ | ||
@@ -78,3 +74,3 @@ "encoding":"ascii", | ||
}) | ||
```` | ||
``` | ||
@@ -92,7 +88,8 @@ | ||
| Version | Changes | | ||
|--------------------|-----------------------------------| | ||
| 1.0.8 | Error handling improved. Now **fileName** is relative path to output path specified | | ||
| Version | Changes | | ||
|--------------------|-----------------------------------| | ||
| 1.0.8 | Error handling improved. Now **fileName** is relative path to output path specified | | ||
| 1.0.10 | File watching feature added, result will be automatically refreshed if json files are modified | | ||
| 1.0.11 | Publish issues with previous version | | ||
@@ -99,0 +96,0 @@ ## Sample |
145
24257
110