This repository has been archived by the owner. It is now read-only.
json loader module for webpack - UNMAINTAINED
Clone or download
Latest commit 94d37ad Aug 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore chore: Adds release tooling Jul 22, 2017
CHANGELOG.md chore(release): 0.5.7 Jul 22, 2017
LICENSE docs: Update License to match with webpack/webpack Jul 22, 2017
README.md Fix link Aug 20, 2018
index.js fix: Strip deprecation warning (#58) Jul 22, 2017
package-lock.json chore(release): 0.5.7 Jul 22, 2017
package.json chore(release): 0.5.7 Jul 22, 2017

README.md

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

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

Maintainer


Tobias Koppers