merge-jsons-webpack-plugin
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -151,3 +151,8 @@ "use strict"; | ||
if (this.options.prefixFileName) { | ||
entryDataAsJSON[path.basename(f, allowedExtensions)] = fileContent; | ||
if (typeof this.options.prefixFileName === 'function') { | ||
entryDataAsJSON[this.options.prefixFileName(f)] = fileContent; | ||
} | ||
else { | ||
entryDataAsJSON[path.basename(f, allowedExtensions)] = fileContent; | ||
} | ||
} | ||
@@ -154,0 +159,0 @@ else { |
@@ -0,0 +0,0 @@ Apache License |
{ | ||
"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.18", | ||
"version": "1.0.19", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "email": "sudharsan_tk@yahoo.co.in", |
@@ -106,3 +106,3 @@ # Merge json files | ||
| globOptions | Optional, [glob options](https://github.com/isaacs/node-glob#options) to change pattern matching behavior. | | | ||
| prefixFileName | if true ,file names will be prefixed to each file content and merged with outfile. | | ||
| prefixFileName | Optional. If true, file names will be prefixed to each file content and merged with outfile<br><br>By default, the generated prefix is simply the filename without the .json extension. If you want to customize the process of generating prefixes, you can pass a function as this option. The function should take exactly one argument (the file path) and returns the prefix.| | ||
@@ -123,2 +123,3 @@ ## Change Logs | ||
| 1.0.18 | Bom issue fix #22 | | ||
| 1.0.19 | Support for custom "prefixFileName" function | | ||
@@ -125,0 +126,0 @@ ## Sample |
246
143
29687