merge-jsons-webpack-plugin
merge-jsons-webpack-plugin copied to clipboard
GroupBy pattern : files are not merged when a space exist in pattern
I faced an issue regarding pattern, when a space exist in the pattern definition : These groupBy definitions will not work, because of the spaces, after the coma, or at the end of the pattern
groupBy: [
{
pattern: '{../../libs/sdk/src/resources/i18n/**/en.json, ./src/resources/i18n/**/en.json}',
fileName: 'resources/i18n/en.json'
}
]
groupBy: [
{
pattern: '{../../libs/sdk/src/resources/i18n/**/en.json,./src/resources/i18n/**/en.json }',
fileName: 'resources/i18n/en.json'
}
]
When writing the pattern, I felt as if it was a json object... when it's not. Is it possible to define the pattern as a string or an array of string, to avoid this kind of errors ?
groupBy: [
{
pattern: ['../../libs/sdk/src/resources/i18n/**/en.json', './src/resources/i18n/**/en.json'],
fileName: 'resources/i18n/en.json'
}
]
@julienboulay , its handled by external package glob, it expects a string rather than an array of object. What I am planning to do is to sanitize the string (remove any spaces), do you think it makes sense? so that I dont break any existing code .
Hi @tettusud,
First, thank you for this great plugin. Yes, it make sense to keep the current behaviour and sanitize the string. It may also be very interesting to display a log message if no file corresponding to pattern was found.