json-loader

by webpack-contrib

webpack-contrib / json-loader

json loader module for webpack - UNMAINTAINED

431 Stars 79 Forks Last release: about 3 years ago (v0.5.6) MIT License 38 Commits 7 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

npm node deps tests coverage chat

JSON Loader

Install

npm install --save-dev json-loader

⚠️ Since

webpack >= v2.0.0
, importing of JSON files will work by default. You might still want to use this if you use a custom file extension. See the v1.0.0 -> v2.0.0 Migration Guide for more information

Usage

Inline

const json = require('json-loader!./file.json');

Configuration
(recommended)

const json = require('./file.json');

webpack.config.js

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

Maintainer

    <a href="https://github.com/sokra">Tobias Koppers</a>
  </td>
</tr>

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.