webpack-contrib / json-loader

json loader module for webpack - UNMAINTAINED

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docs(README): revert to `webpack =< v1.0.0` usage instructions

nbkhope opened this issue · comments

I am using Webpack version 1 and had to use the plugin to load a json file.

For some reason I was not getting anything to work until reading this Stack Overflow answer, which had different configuration (essentially different key names in the object).

Please add a warning or at least say in the README that those are instructions for Webpack 2. It would also be nice to have installation instructions for webpack v1 (if they are not already here somewhere?).

Webpack v2 config (shown in README):

module: {
  rules: [
    {
      test: /\.json$/,
      use: 'json-loader'
    }
  ]
}

Webpack v1 config (not mentioned anywhere in the README)

module: {
  loaders: [
    {
      test: /\.json$/,
      loader: 'json-loader'
    }
  ]
}

in v1, not rules, but loaders; not use, but loader