title: Webpack error when importing a json file
body: <p>Here is a simple test case that breaks:</p>
  
  <p>First, save a json file from Node:</p>
  
  <pre><code>const fs = require('fs')
  
  let test = {
    foo: [
      { 1: 'a'},
      { 2: 'b'}
    ]
  };
  
  fs.writeFileSync('./test.json', JSON.stringify(test), 'utf-8');
  </code></pre>
  
  <p>Then, try importing this json into a js file that is processed by Webpack (I am using the latest version of Webpack, 3.4.1):</p>
  
  <pre><code>import test from './test.json';
  
  console.log(test);
  </code></pre>
  
  <p>This fails with the following error:</p>
  
  <pre><code>ERROR in ./test.json                                       
  Module build failed: SyntaxError: Unexpected token, expected ; (1:6)
  
  &gt; 1 | {"foo":[{"1":"a"},{"2":"b"}]}
  </code></pre>
  
  <p>The offending character that the console output is pointing at is the colon after "foo".</p>
  
  <p>My Webpack config was very simple, with only these <code>module</code> options:</p>
  
  <pre><code>  module: {
      rules: [
        {
          test: /\.js/,
          exclude: [ path.resolve(__dirname, 'node_modules') ],
          loader: 'babel-loader'
        },
        {
          test: /\.css$/,
          use: ExtractTextPlugin.extract({
            fallback: "style-loader",
            use: "css-loader"
          })
        }
      ]
    },
  </code></pre>
  
  <p>Confused, I opened the JSON loader page, which informed me that:</p>
  
  <blockquote>
    <p>Since webpack >= v2.0.0, importing of JSON files will work by default.</p>
  </blockquote>
  
  <p>Since I was using Webpack v. 3.4.1, I assumed json-loader was unnecessary. Still, out of desperation, I added the following rule to the modules field of Webpack config:</p>
  
  <pre><code>  {
      test: /\.json/,
      loader: 'json-loader'
    }
  </code></pre>
  
  <p>This actually worked! The json file got loaded, and the error disappeared.</p>
  
  <p><strong>So my question is:</strong> was I doing something wrong with Webpack trying to import the json file, or is the newest Webpack somehow broken as regards to the importing of json files?</p>