Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webpack-contrib/json-loader
json loader module for webpack - UNMAINTAINED
https://github.com/webpack-contrib/json-loader
deprecated json webpack-attic webpack-loader
Last synced: about 2 months ago
JSON representation
json loader module for webpack - UNMAINTAINED
- Host: GitHub
- URL: https://github.com/webpack-contrib/json-loader
- Owner: webpack-contrib
- License: mit
- Archived: true
- Created: 2012-04-06T10:25:57.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T10:53:02.000Z (over 6 years ago)
- Last Synced: 2024-09-06T15:59:03.313Z (4 months ago)
- Topics: deprecated, json, webpack-attic, webpack-loader
- Language: JavaScript
- Homepage:
- Size: 84 KB
- Stars: 436
- Watchers: 19
- Forks: 82
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![coverage][cover]][cover-url]
[![chat][chat]][chat-url]Install
```bash
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](https://webpack.js.org/migrate/3/#json-loader-is-not-required-anymore) for more information**
Usage
### `Inline`
```js
const json = require('json-loader!./file.json');
```### `Configuration` (recommended)
```js
const json = require('./file.json');
```**webpack.config.js**
```js
module.exports = {
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
}
```Maintainer
[npm]: https://img.shields.io/npm/v/json-loader.svg
[npm-url]: https://npmjs.com/package/json-loader[node]: https://img.shields.io/node/v/json-loader.svg
[node-url]: https://nodejs.org[deps]: https://david-dm.org/webpack/json-loader.svg
[deps-url]: https://david-dm.org/webpack/json-loader[tests]: http://img.shields.io/travis/webpack/json-loader.svg
[tests-url]: https://travis-ci.org/webpack/json-loader[cover]: https://coveralls.io/repos/github/webpack/json-loader/badge.svg
[cover-url]: https://coveralls.io/github/webpack/json-loader[chat]: https://badges.gitter.im/webpack/webpack.svg
[chat-url]: https://gitter.im/webpack/webpack