Support json modules
This is a proposal for a fix to #74. It is not elegant but it gets the job done. The way the NormalModuleFactory is found from the dependencyFactories is probably not the right way to do it, but I don't have a good enough understanding on how to do this stuff, and this is the proposal I was able to come up with:-)
The example environment that this PR is fixing is: index.js:
require("bundle-loader!./test.json");
test.json:
{ "any": "json file" }
Without this fix, this currently returns the error:
ERROR in ./src/test.json (./node_modules/bundle-loader!./src/test.json) Module parse failed: Unexpected token v in JSON at position 0 while parsing near 'var cbs = [], data...' You may need an appropriate loader to handle this file type.
ping. The bug this pr fixes is a showstopper when using json files with webpack 4.
Ping @michael-ciniawsky, sorry for the noise - any news on this?
I can verify that this PR also fixes the issue for me with no adverse side effects that I notice. Would be great to get this, or an equivalent, merged @michael-ciniawsky
This PR also fixed the issue for me. Are there other maintainers than @michael-ciniawsky who could check this pull request?
@michael-ciniawsky Could you comment on this? Or maybe point us to someone who would be able to review this?