<h2 dir="auto">Feature request</h2>





<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">I'm currently using the asset/resource module rule to explicitly generate a JSON bundle containing runtime settings (pure JSON - no JS) with the filename "[name].[contenthash].bundle.json". When importing the JSON file in my entry file I'm provided with the hashed filename, which I pass to a window.fetch request to retrieve the JSON content.</p>
<p dir="auto">The intent of this JSON file is to serve as appsettings file, allowing runtime settings to be modified after deployment. The browser would always fetch this file during the entry point bootstrapping process.</p>
<p dir="auto">I was wondering whether it's possible to combine multiple JSON files into one before generating the asset/resource? For example, if appsettings.dev.json was present, a single JSON bundle would be generated from the combined results of merging appsettings.json and appsettings.dev.json.</p>
<p dir="auto">It's not clear whether asset/resource can be chained with other loaders? Originally I was thinking of writing my own loader which transforms the appsettings.json with the dev config (if present) using webpack-merge, however I think I'd need to chain in the file-loader which has been deprecated in v4.</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong><br>
I'd like to simplify local development by adding an optional appsettings.dev.json file which is merged with appsettings.json.</p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong><br>
Don't have prerequisite knowledge just yet...</p>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
Don't have prerequisite knowledge just yet...</p>
<p dir="auto">During app rebuild this error happens:</p>
<p dir="auto">let data = module.buildInfo.jsonData;<br>
TypeError: Cannot read property 'jsonData' of undefined</p>
<p dir="auto">Webpack 5.42.0</p>