Skip to content

mc-zone/json-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps tests coverage chat

JSON Loader

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

Install

npm install --save-dev json-loader

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

About

json loader module for webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%