merge-jsons-webpack-plugin
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -35,2 +35,3 @@ /* | ||
new MergeJsonWebpackPlugin({ | ||
"encoding":"ascii", | ||
"output": { | ||
@@ -37,0 +38,0 @@ "groupBy": [{ |
@@ -7,2 +7,3 @@ "use strict"; | ||
var _root = path.resolve(__dirname, "./"); | ||
var UTF8_ENCODING = "utf8"; | ||
var MergeJsonWebpackPlugin = (function () { | ||
@@ -28,3 +29,8 @@ function MergeJsonWebpackPlugin(options) { | ||
try { | ||
entryData = fs.readFileSync(f, 'utf8'); | ||
var encoding = _this.options.encoding; | ||
if (!encoding) { | ||
encoding = UTF8_ENCODING; | ||
} | ||
console.log('encodin ', encoding); | ||
entryData = fs.readFileSync(f, encoding); | ||
} | ||
@@ -31,0 +37,0 @@ catch (e) { |
{ | ||
"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.6", | ||
"version": "1.0.7", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "email": "sudharsan_tk@yahoo.co.in", |
@@ -40,10 +40,9 @@ # Merge json files | ||
````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" | ||
} | ||
}) | ||
@@ -54,8 +53,8 @@ | ||
| Field Name | Description | | ||
|----------------- |---------------------------------- | | ||
| files | Array of json files to be merged | | ||
| output.fileName | Name of merged output file | | ||
| Field Name | Description | | ||
|----------------- |---------------------------------- | | ||
| files | Array of json files to be merged | | ||
| output.fileName | Name of merged output file | | ||
| encoding | Optional,encoding to be used default is utf-8 | | ||
@@ -69,2 +68,3 @@ 2. **By Patterns** | ||
new MergeJsonWebpackPlugin({ | ||
"encoding":"ascii", | ||
"output":{ | ||
@@ -89,3 +89,3 @@ "groupBy":[ | ||
| groupBy[].fileName | output file name for the corresponding pattern. | | | ||
| encoding | Optional,encoding to be used default is utf-8 | | | ||
@@ -92,0 +92,0 @@ ##Sample |
28489
291