Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Support json modules #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support json modules #75

wants to merge 1 commit into from

Conversation

rmja
Copy link

@rmja rmja commented Jul 4, 2018

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.

This is a proposal for a fix to webpack-contrib#74. It is not elegant but it gets the job done
@jsf-clabot
Copy link

jsf-clabot commented Jul 4, 2018

CLA assistant check
All committers have signed the CLA.

@rmja
Copy link
Author

rmja commented Aug 24, 2018

ping. The bug this pr fixes is a showstopper when using json files with webpack 4.

@rmja
Copy link
Author

rmja commented Sep 15, 2018

Ping @michael-ciniawsky, sorry for the noise - any news on this?

@billneff79
Copy link

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

@maksis
Copy link

maksis commented Feb 18, 2019

This PR also fixed the issue for me. Are there other maintainers than @michael-ciniawsky who could check this pull request?

@rmja
Copy link
Author

rmja commented Jan 29, 2020

@michael-ciniawsky Could you comment on this? Or maybe point us to someone who would be able to review this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants