Skip to content
This repository was archived by the owner on Aug 20, 2018. It is now read-only.

webpack v4 - compatibility #65

Open
deleonio opened this issue Feb 26, 2018 · 7 comments
Open

webpack v4 - compatibility #65

deleonio opened this issue Feb 26, 2018 · 7 comments

Comments

@deleonio
Copy link

thx

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 26, 2018

webpack >= v2.0.0 has 'native'/direct JSON support. Since webpack >= v4.0.0 it's a module.type (no JS wrapper needed anymore). You can remove the json-loader from your setup. Otherwise please provide more info about what 'compatibility' exactly means here :).

⚠️ It's possible the json-loader causes issue with webpack >= v4.0.0, because the loader issues a JS Module (module.type = 'javascript/auto'), which isn't needed anymore/doesn't work with module.type = 'json' (JSONParser) by default

@zjr
Copy link

zjr commented Feb 26, 2018

This (removing json-loader) fixed an issue I was having with webpack throwing errors about Unexpected token in package.jsons.

@michael-ciniawsky
Copy link
Member

@zjr I will add a note to the README when I have a few minutes :)

@zjr
Copy link

zjr commented Feb 26, 2018

Thanks!

@deleonio
Copy link
Author

@michael-ciniawsky removing the loader works. Thank you all.

@retorquere
Copy link

Is there a possibility to override the webpack-builtin json-loader? I have my own and it looks like the output of mine is being fed into json-loader (which then errors out, because my loader returns JS code, not JSON code)

@michael-ciniawsky
Copy link
Member

@retorquere webpack/webpack#6572

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

No branches or pull requests

4 participants