json-loader

json loader module for webpack

MIT 18 个版本
安装
npm install json-loader
yarn add json-loader
pnpm add json-loader
bun add json-loader
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
版本列表
0.5.7 2017-07-22
0.5.6 2017-07-22
0.5.5 2017-07-22
0.5.4 2015-11-23
0.5.3 2015-09-16
0.5.2 2015-05-24
0.5.1 2014-05-22
0.5.0 2013-02-01
0.2.0 2012-09-25
0.1.8 2012-08-03
0.1.7 2012-08-03
0.1.6 2012-05-20
0.1.5 2012-04-04
0.1.4 2012-04-03
0.1.3 2012-04-03
0.1.2 2012-04-02
0.1.1 2012-03-27
0.1.0 2012-03-26