Skip to content

Why isn't json-loader enabled by default? #2370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mik01aj opened this issue Apr 21, 2016 · 5 comments
Closed

Why isn't json-loader enabled by default? #2370

mik01aj opened this issue Apr 21, 2016 · 5 comments
Labels

Comments

@mik01aj
Copy link

mik01aj commented Apr 21, 2016

I'm coming from fb55/entities#26. It's a commonly used tiny library, and the fact that it uses JSON files internally (which is fine with both Node and Browserify) requires anyone using libraries that use libraries that depend on entities add the json loader explicitly to their webpack config. I wonder why JSON files aren't handled correctly by default.

@sokra , could you please explain this design decision? Would you accept a PR changing this?

@Someguy123
Copy link

I can confirm this is annoying. I believe BitcoinJS also uses JSON files, which is why I had to enable it in my project (even though other things such as Browserify seem to support it by default)

@mik01aj
Copy link
Author

mik01aj commented Jun 3, 2016

@webpack, @sokra any feedback?

@agundermann
Copy link

#184 (comment)

@kentcdodds
Copy link
Member

Seems to me like the reasons @sokra listed in #184 are legit and wont change so this should probably be closed.

@mik01aj
Copy link
Author

mik01aj commented Jun 15, 2016

seems so, yes.

For the record:

I will not make the json-loader default for three reasons:

  • It's not backward-compatible: This means it will break all applications that use json files...
  • It would be impossible/difficult/hard to understand to use another loader for json files. I. e. the json5-loader.
  • It's weird/hard to understand to make all loaders explicit and only the json-loader is default.

@mik01aj mik01aj closed this as completed Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants