Illia Kozyr c722a49f64 React Project DONE 2 年之前
..
.npmignore c722a49f64 React Project DONE 2 年之前
CHANGELOG.md c722a49f64 React Project DONE 2 年之前
LICENSE c722a49f64 React Project DONE 2 年之前
README.md c722a49f64 React Project DONE 2 年之前
index.js c722a49f64 React Project DONE 2 年之前
package.json c722a49f64 React Project DONE 2 年之前

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