Skip to content
This repository was archived by the owner on Aug 20, 2018. It is now read-only.

json loader module for webpack - UNMAINTAINED

License

Notifications You must be signed in to change notification settings

webpack-contrib/json-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps tests coverage chat

JSON Loader

Install

npm install --save-dev json-loader

⚠️ Note: Since webpack v2, importing of JSON files will work by default. You might still want to use this if you use a custom file extension.

Usage

Configuration (recommended)

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.json$/,
        use: 'json-loader'
      }
    ]
  }
}
import json from 'file.json';

CLI

webpack --module-bind 'json=json-loader'
import json from 'file.json';

Inline

import json from 'json-loader!file.json';

Maintainer


Tobias Koppers