Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

json-loader

webpack3.8mMIT0.5.7

json loader module for webpack

readme

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');
const json = require('./file.json');

webpack.config.js

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

Maintainer


Tobias Koppers

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.5.7 (2017-07-22)

Bug Fixes

0.5.6 (2017-07-22)

Bug Fixes

  • index: only export CJS modules (webpack v1.0.0) && add deprecation warning (webpack v2.0.0) (#55) (d34395a)

0.5.5 (2017-07-22)

Bug Fixes

  • add stringify option to output JSON object as string (#45) (dbf1fa5)
  • Don't stringify with tabs to improve perf (ee75f99), closes #31
  • escape newline/paragraph separators (#18) (939a8cb)
  • Remove confusing statement about polyfill (a06933c), closes #7

Reverts

  • add stringify option to output JSON object as string (#43) (#52) (e528e1d)

0.5.4 (2017-07-22)

Bug Fixes

  • add stringify option to output JSON object as string (#45) (bb495b8)
  • escape newline/paragraph separators (#18) (e70851e)

Reverts

  • add stringify option to output JSON object as string (#43) (#52) (368cf18)